我怎样才能把FragmentTabHost标签在屏幕的底部? [英] How can I put FragmentTabHost Tabs at the bottom of the screen?
本文介绍了我怎样才能把FragmentTabHost标签在屏幕的底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我曾尝试以下code。它对准上面的标签插件的框架布局,但它仍然没有奏效
I have tried the following code. which aligns the framed layout above the tab widget but it still didn't work
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal" />
<FrameLayout
android:id="@+id/tabFrameLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_alignParentTop="true"
android:layout_above="@android:id/tabs"
/>
</RelativeLayout>
</android.support.v4.app.FragmentTabHost>
修改 我使用FragmentTabHost。也许这可能是为什么它不改变立场
edit i am using FragmentTabHost. maybe that could be why it's not changing position
推荐答案
这终于研究出了解决方法如下:
The solution which finally worked for is the following:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
</android.support.v4.app.FragmentTabHost>
</LinearLayout>
这篇关于我怎样才能把FragmentTabHost标签在屏幕的底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文