【问题标题】:Tab Activity: Some space at the top of tab content选项卡活动:选项卡内容顶部的一些空间
【发布时间】:2012-10-27 21:25:52
【问题描述】:

我创建了自己的自定义 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>

【问题讨论】:

    标签: android tabactivity


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2011-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多