gpt4 book ai didi

android:tabStripEnabled ="false"不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:05:51 25 4
gpt4 key购买 nike

我正在使用 tabhost 并试图禁用标签边框线。我用过这个 android:tabStripEnabled="false"在我的 XML 中,但它似乎不起作用,该行仍然存在,我尝试其他方式,例如更改 style.xml(我从 stackoverflow 中找到),但它也不起作用。有什么想法吗?

我的标签 xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<RelativeLayout
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="fill_parent"
android:layout_above="@android:id/tabs" />

<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#FFFFFF"
android:tabStripEnabled="false"
android:layout_gravity="bottom" />
</RelativeLayout>
</TabHost>

</LinearLayout>

最佳答案

您可以使用以下语句删除选项卡的底部 strip 和选项卡之间的分隔线。

    TabHost t;
t.getTabWidget().setStripEnabled(false);
t.getTabWidget().setDividerDrawable(R.drawable.ic_launcher);

关于android:tabStripEnabled ="false"不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12047693/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com