android选项卡不能在屏幕下方显示出来,解决方法
2013-12-11 15:44
411 查看
android选项卡不能在屏幕下方显示出来,解决方法
android中用到tabActivity时需要一个布局文件,布局文件一般如下东西:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TabHost
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"
android:background="@drawable/tabcontentback" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@android:color/transparent">
</FrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none"
android:background="@android:color/transparent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:orientation="horizontal"
android:gravity="center"
android:divider="@null">
</TabWidget>
</HorizontalScrollView>
</LinearLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
由上述布局文件可以看出,选项卡是设置在下面的。但是,如果没有上面红色部分 android:layout_weight="1"的设置,就会出现不能在下方显示选项卡的情况。
android中用到tabActivity时需要一个布局文件,布局文件一般如下东西:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TabHost
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"
android:background="@drawable/tabcontentback" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="@android:color/transparent">
</FrameLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fillViewport="true"
android:scrollbars="none"
android:background="@android:color/transparent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:orientation="horizontal"
android:gravity="center"
android:divider="@null">
</TabWidget>
</HorizontalScrollView>
</LinearLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
由上述布局文件可以看出,选项卡是设置在下面的。但是,如果没有上面红色部分 android:layout_weight="1"的设置,就会出现不能在下方显示选项卡的情况。
相关文章推荐
- Android自定义控件:imageview重写onMeasure方法实现图片按指定比例显示,拉伸永不变形,解决屏幕适配问题
- 解决使用了subList方法之后MPAndroidChart不能显示数据的Bug
- Android中Button文字不能一行显示解决方法
- android imageview 图片不能正常显示 或不能自适应的解决方法
- android imageview 图片不能正常显示 或不能自适应的解决方法
- Android屏幕显示旋转180度解决方法
- Android解决百度地图SDK打包后不能显示地图的方法
- Android手机上浏览网页不可缩放,适应屏幕。iPhone手机显示网页,字体等变小了,解决方法
- 关于在win7环境下线程里调用SaveFileDialog不能显示的解决方法
- Android 导入android源码有错,R.java文件不能自动生成解决方法
- 解决android 关于Toast重复显示解决方法
- 彻底解决Android 应用方法数不能超过65K的问题
- android listview嵌套时,显示不全和不能滑动的解决
- Android 代码中文字在手机上显示乱码问题解决方法
- cmd命令提示符不能输入显示中文的解决方法
- 【Vegas原创】访问owa,图片和js脚本不能正常显示和使用的解决方法
- sublime text下代码太长brackethighlighter不能正确显示闭合高亮的解决方法
- 彻底解决Android 应用方法数不能超过65K的问题
- Android界面调试的基本方法---bitmap显示出来
- 用VS打开html文件左下方不显示设计-拆分-源视图的解决方法