读书人

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

发布时间: 2013-03-14 10:33:15 作者: rapoo

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顶到下面去。

读书人网 >Android

热点推荐