【发布时间】:2013-05-02 06:59:06
【问题描述】:
我正在处理 TabWidget,并且在 TabActivity 和 Tabs 之间出现了一个空白。
我不知道如何删除这个空白请任何人帮助我应该如何删除它,我的 tab_main.xml 如下:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TabHost
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0" />
</LinearLayout>
</TabHost>
我尝试将 TabWidget 的背景颜色设置为 android:color:transparent 但在 Activity 和 Tab 之间仍然存在相同的空白。
我不希望我的 Activity 和选项卡之间有任何分隔空间(可以这样做吗?)
请任何人建议我如何摆脱这个空白。
【问题讨论】:
-
您是否尝试过将
TabWidget的高度设置为类似于框架布局的0dp?此外,如果您的目标是 API 8 或更高版本,则应使用match_parent而不是填充。
标签: java android xml tabs android-widget