使用FragmentTabHost时,tabwidget被frament覆盖。
16lz
2022-01-21
原始布局文件:
<android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> 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" /> <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="match_parent" /> <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="match_parent" /></android.support.v4.app.FragmentTabHost>
解决方法,更改后布局文件
<android.support.v4.app.FragmentTabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <RelativeLayout 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" /> <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="match_parent" /> <FrameLayout android:id="@+id/realtabcontent" android:layout_width="match_parent" android:layout_height="match_parent" /> </RelativeLayout> </LinearLayout></android.support.v4.app.FragmentTabHost>
更多相关文章
- android 常用的代码
- Android分享文件到微信和QQ功能的实现(兼容android 7.0以上的共享
- Android热修复之AndFix
- 系统总结归纳一下android
- app在android studio的构建过程
- android的文件操作
- 分享几点Android(安卓)开发中的小技巧吧。不知道算不算?
- 浅谈android中的反编译
- NPM 和webpack 的基础使用