1

我创建了自己的自定义 TabActivity。问题是每个页面在标签内容的顶部和底部留下一个小的空白条。我的选项卡布局尝试填充父级,但仍然可以看到一些条带。

屏幕

蓝色的下条应接触上条。

我的标签活动 xml 布局:

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >


    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/navigation_bar"
        android:paddingTop="8dp" >

        <Button
            android:id="@+id/btnRecipesChosen"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="@dimen/navigatorBarLeftRightButtonsMargin"
            android:background="@drawable/button_chosen" >
        </Button>

        <Button
            android:id="@+id/btnRecipesFind"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_gravity="right"
            android:layout_marginRight="@dimen/navigatorBarLeftRightButtonsMargin"
            android:background="@drawable/button_find" >
        </Button>
    </RelativeLayout>

    <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"

        android:layout_marginBottom="-9dp"
        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>

4

1 回答 1

0

答案可能为时已晚,但我遇到了同样的问题,所以这可能有助于其他人寻找相同问题的解决方案......试试这个项目中的可绘制 xml 文件并尝试替换的布局 xml 文件选项卡 xml 就像它在这个项目中所做的一样。希望它有效!

于 2013-05-08T08:24:15.847 回答