Showing something OVER the tabs.

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Showing something OVER the tabs.

Postby Mplourde » Fri Nov 07, 2008 4:12 am

Hello devs,

I've been trying to use tabs in my application by following some tutorials...Only thing that worked was extending the TabActivity class. Everything else (TabHost, TabWidget, etc) didn't work. I suppose the tutorials were too old or something. So now I've got a TabActivity and I can create some tabs. Yay. Is there ANY way to show something at the top of the tabs? I want to have a label OVER the tabs. For example, I would like to have The words "Create your own recipe" at the top of all the tabs. I used the API demo of the Tabs from Google and it uses an XML layout containing a FrameLayout as the root node. I tried adding a TextView at the top of it, but it gets included within each tab instead of showing it at the top. Is there any way to do what I want to do?

The code I use right now is the same thing as the Tab examples of the API demos.

Thanks for your help!
Mplourde
Freshman
Freshman
 
Posts: 4
Joined: Fri Oct 03, 2008 2:14 am

Top

Postby Sparkletron » Thu Nov 13, 2008 6:07 pm

Instead of populating your contentView with just a tabHost, create a LinearLayout, set its orientation to vertical, add whatever widget you want to appear over your tabs, followed by your tabHost. Then set your contentView to the linearLayout. I tested with an EditText and TextView widget and it works fine.
Sparkletron
Developer
Developer
 
Posts: 26
Joined: Tue Nov 04, 2008 6:17 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests