I’m trying to write an activity that has a RelativeLayout on top with options, and then a tabhost below that layout that contains 2 tabs.
Unfortunately, when I add a tabhost to my layout, it gets put on top of the activity it’s in, no matter where it’s defined in the layout. According to the docs ” The TabHost must be the root node for the layout”, does this mean I can’t have it being part of the layout as opposed to the topmost element?
I tried different heights for the TabHost, from fill_parent to wrap_content to 50dip, but nothing affected placement and it just was drawn on top of all the other elements.
Thanks
Don’t confuse a
TabHostview with aTabActivity. You can have anActivitywhich is not aTabActivity, and within its layout, any number ofTabHostviews, arranged and grouped however you like.For example, see this sample code, which displays two different sets of tabs at once so you can compare the appearance of custom versus default styles.