Android在tabwidget中的标签之间删除空格

我制作的应用程序具有类似于HelloTabActivity的选项卡,这些选项卡之间也有空格,任何人都可以建议如何删除此空间,并且选项卡下方还有一条灰线如何将其删除?

main.xml


<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

android:orientation="vertical"

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:orientation="vertical"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent"

        android:padding="5dp" >

        <HorizontalScrollView

            android:layout_width="wrap_content"

            android:layout_height="wrap_content"

            android:scrollbars="none">

            <TabWidget

                android:id="@android:id/tabs"

                android:layout_width="fill_parent"

                android:layout_height="wrap_content" />

        </HorizontalScrollView>

        <FrameLayout

            android:id="@android:id/tabcontent"

            android:layout_width="fill_parent"

            android:layout_height="fill_parent"

            android:padding="5dp" />

    </LinearLayout>

</TabHost>

</LinearLayout>

styles.xml


<?xml version="1.0" encoding="utf-8"?>

<resources>

<style name="CustomTheme" parent="@android:style/Theme">

    <item name="android:tabWidgetStyle">@style/CustomTabWidget</item>

</style>

<style name="CustomTabWidget" parent="@android:style/Widget.TabWidget">

    <item name="android:textAppearance">@style/CustomTabWidgetText</item>

</style>

<style name="CustomTabWidgetText" 

    parent="@android:style/TextAppearance.Widget.TabWidget">

    <item name="android:textSize">10sp</item>

    <item name="android:textStyle">bold</item>

    <item name="android:textColor">#1589FF</item>

    <item name="android:padding">3dip</item>

</style>



</resources>


现在我想删除选项卡之间的黑色空间,应该像它们已连接一样,而且我也无法删除选项卡下方的灰线。

慕森卡
浏览 584回答 3
3回答

海绵宝宝撒

在xml布局中使用android:showDividers =“ none”。<TabWidget&nbsp; &nbsp; &nbsp; &nbsp; android:id="@android:id/tabs"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="fill_parent"&nbsp; &nbsp; &nbsp; &nbsp; android:showDividers="none"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"/>
打开App,查看更多内容
随时随地看视频慕课网APP