【发布时间】:2010-06-29 06:46:54
【问题描述】:
我正在将 Tabhost 用于项目选项卡。我将选项卡的颜色更改为蓝色,但选项卡下方有 2px 线。谁能帮我把白色改成蓝色。 http://img816.imageshack.us/img816/228/device.png
【问题讨论】:
-
我很好奇你是如何获得这个职位的,你能分享你的代码吗?
标签: android android-style-tabhost
我正在将 Tabhost 用于项目选项卡。我将选项卡的颜色更改为蓝色,但选项卡下方有 2px 线。谁能帮我把白色改成蓝色。 http://img816.imageshack.us/img816/228/device.png
【问题讨论】:
标签: android android-style-tabhost
您的屏幕设计可能存在与 TabHost 无关的问题。您是否检查了屏幕/小部件/布局填充?
以下代码 sn-p 完全符合您的要求。添加另一个选项卡就可以了。
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@android:id/tabs">
<include android:id="@+id/tab1" layout="@layout/tab1" />
<include android:id="@+id/tab2" layout="@layout/tab2" />
<include android:id="@+id/tab3" layout="@layout/tab3" />
</FrameLayout>
</RelativeLayout>
</TabHost>
【讨论】:
我不知道是否仍然没有界面可以自定义或禁用选项卡下方的栏,但也有兴趣回答。
【讨论】: