Android TabWidget白色空间问题

iOS*_*Bee 7 java xml tabs android android-widget

我正在使用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>
Run Code Online (Sandbox Code Playgroud)

我试图将TabWidget的背景颜色添加到android:color:transparent但是Activity和Tab之间仍然有相同的空白区域.

我不希望我的Activity和Tabs之间有任何分隔空间(是否可以这样做?)

任何人都可以建议我如何摆脱这个空白区域.

在此输入图像描述

小智 0

看起来您遇到的问题与我在我的项目中遇到的问题类似,请查看项目并尝试实现可绘制的 xml 文件,并为您的 TabWidget 提供此项目中给出的特定自定义尺寸。它一定会对你有用。