首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

tabHost中将选项卡放在底部?该怎么解决

2013-03-14 
tabHost中将选项卡放在底部??xml version1.0 encodingutf-8?TabHost xmlns:androidhttp://sche

tabHost中将选项卡放在底部?
<?xml version="1.0" encoding="utf-8"?>  
  
<TabHost 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:orientation="vertical"  
  
                android:layout_width="fill_parent"  
  
                android:layout_height="fill_parent"  
  
                >  
  
                <FrameLayout  
  
                        android:id="@android:id/tabcontent"  
  
                        android:layout_width="fill_parent"  
  
                        android:layout_height="0dip"  
  
                        android:layout_weight="1"  
  
                        />  
  
                <TabWidget  
  
                        android:id="@android:id/tabs"  
  
                        android:layout_width="fill_parent"  
  
                        android:layout_height="wrap_content"  
  
                        android:layout_weight="0"  
  
                        android:background="#ff000000"  
  
                        />  
  
        </LinearLayout>  
  
</TabHost>
在网上看了好几种,感觉这种还行,但是有几个不懂得,为什么在framelayout和tabwidget中要重复定义layout_width?

android
[解决办法]
这俩不是一个东西,当然要各有各的layout_width了。
如果你想说的是layout_weight,布局的时候就是靠这个weight才能把TabWidget顶到下面去。

热点排行