选项卡活动:选项卡内容顶部的一些空格

时间:2012-10-27 21:25:52

标签: android tabactivity

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

screen

蓝色的下条应该接触上条。

我的标签活动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>

1 个答案:

答案 0 :(得分:0)

答案可能为时已晚,但我有点相同issue所以这可能有助于其他人为同一问题寻找解决方案...在{{3}中试用可绘制的xml文件} project并尝试替换tab xml的布局xml文件,就像在this项目this中完成的那样..希望它有效!!