android开发之如何使TabHost的TabWidget位于屏幕下方
2015-12-09 11:44
537 查看
更改TabHost里的第一个LinearLayout为RelativeLayout。并在TabWidget中添加android:layout_alignParentBottom="true"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/RelativeLayout1"
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" >
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/tab1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab3"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab4"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
</FrameLayout>
</RelativeLayout>
</TabHost>
</FrameLayout>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/RelativeLayout1"
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" >
</TabWidget>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/tab1"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab3"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:id="@+id/tab4"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</LinearLayout>
</FrameLayout>
</RelativeLayout>
</TabHost>
</FrameLayout>
相关文章推荐
- Android实现实时视频通话或监控方案
- Android 沉浸式状态栏实现,以及遇到的问题
- android studio 2.0 preview 编译报错
- Android Studio JNI 基础入门--Hello World
- Android通过URL跟web服务器通信那点破事
- android:ToolBar详解(手把手教程)
- 吐槽Android的SharedPreferences(保存不了数据)
- Android适配全攻略(分享)
- AndroidStudio里怎样引用aar文件
- Android 的 SDK Manager 无法启动 闪退解决方法
- 一个不错的loading效果
- Android studio 32位系统出错:Gradle 'test' project refresh failed
- Android短信发送流程(原)
- Android Studio中JNI程序的单步调试和日志打印
- android adb 远程
- Android——ListView与内部item点击抢焦点问题
- Android Studio调试功能使用总结
- Gallery和ImageSwitcher
- Android开发者网址导航
- 每个Android开发者都应该了解的资源列表