use*_*604 7 android android-actionbar android-tabs
我同意任何想要制作标签应位于屏幕顶部的论点的人,但我无法控制我的应用程序的要求:).我必须在屏幕底部构建一个带标签的应用程序.我正在使用SDK 14和Actionbars.这甚至可能吗?我已经使用底部的选项卡构建了一个布局,但是当我将选项卡添加到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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2542 次 |
| 最近记录: |