android - 如何将 FragmentTabHost 标签放在屏幕底部?

标签 android

我试过下面的代码。将框架布局对齐到选项卡小部件上方,但它仍然不起作用

 <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。也许这就是它不改变位置的原因

最佳答案

最终得到的解决方案如下:

  <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>

关于android - 如何将 FragmentTabHost 标签放在屏幕底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19098366/

相关文章:

android - 如何在后台生成我的缩略图?

Android:将事件发布到View的消息队列

android - 如何使自定义对话框透明?

android - 将 Android.Support Library v7 AppCompat 更新到 21.0.3 版本后出错

java - Canvas 上的 Android Studio drawBitmap 不起作用

已更新的适配器内部 View 的 Android ListView 动画

android - java.lang.IllegalStateException : Can't change tag of fragment

android - 适用于 iOS 和 Android 的 Yammer URL 移动深层链接

android - 什么传感器可以用来检测直立时的旋转?

Android:将声音保存为铃声和通知