I've got simple tab activity with next layout:
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff00" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff00" />
I use buttons as indicators for tabs
tabHost.addTab(tabHost.newTabSpec("Tab1")
.setIndicator(new Button(this))
.setContent(new Intent(this, TabActivity1.class)));
tabHost.addTab(tabHost.newTabSpec("Tab2")
.setIndicator(new Button(this))
.setContent(new Intent(this, TabActivity2.class)));
In this case FrameLayout always got black line and shadow effect on top (you can see it under buttons):
The question is: How can I get rid of this line? Where is the method that draws it in Android sources?
It seems that the way of doing that is to nest the tabwidget in a LinerLayout... Look here.
In your layout xml:
Unfortunately you can't get rid of it. This is a result of how the
TabWidget
is implemented. Internally theTabWidget
is anActivityGroup
and the contents of each tab is its ownActivity
.Apply a custom theme to your activity, and null out the android:windowContentOverlay attribute.
Define a theme in themes.xml:
Apply the theme on your application or the activity in AndroidManifest.xml:
Hope it helps. It caused me lots of headache...
What I suggest you is to use the library provided by GrreenDroid: http://android.cyrilmottier.com/?p=274
Just have a look at The GDTabActivity, you will be able to tweak everything and get rid of this Bar.
http://android.cyrilmottier.com/medias/actionbar/action_bar_4.png