gpt4 book ai didi

屏幕底部的 Android Actionbar 选项卡

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:12:55 26 4
gpt4 key购买 nike

我事先同意任何想要提出选项卡应位于屏幕顶部的论点的人,但我无法控制我的应用程序的要求:)。我必须在屏幕底部构建一个带有选项卡的应用程序。我正在使用 SDK 14 和操作栏。这可能吗?我已经构建了一个底部有选项卡的布局,但是当我将选项卡添加到 ActionBar 时,它们会自动呈现在屏幕顶部。

如有任何想法,我们将不胜感激,感谢大家花时间阅读这篇文章。

最佳答案

你可以使用 Tabhost 作为需求,在 tab.xml 里面你可以写下面的代码。这会很好用。

<?xml version="1.0" encoding="UTF-8"?>
<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:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:tabStripEnabled="false"
android:layout_alignBottom="@android:id/tabcontent"
android:background="#000000" />
</RelativeLayout>
</TabHost>

关于屏幕底部的 Android Actionbar 选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14381455/

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