我想去掉选项卡小部件之间的间距。默认情况下,选项卡之间有大约1像素的间距。我知道一些应用程序,如foursquare或posterous可以去掉它。代码应该是什么样子?我正在使用2.3 API。
谢谢你的帮助。
谢谢你的帮助。
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line" >
<size
android:width="0px"
android:color="@android:color/black"
android:dashWidth="0px"
android:dashGap="0px" />
</shape>
TabWidget android:showDividers="none"
如果你的构建目标是Honeycomb或更高版本,你可以使用以下代码。
if (Integer.parseInt(Build.VERSION.SDK) >= Build.VERSION_CODES.HONEYCOMB) {
tabHost.getTabWidget().setShowDividers(LinearLayout.SHOW_DIVIDER_NONE);
}
tabHost.getTabWidget().setDividerDrawable(null);
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:showDividers="none" />