2012-03-09 133 views
0

我有一个TabHost/TabWidget这样的布局:如何保持重叠TabWidget的布局?

enter image description here

蓝色的框是一个FrameLayout里。我在FrameLayout中有一个RelativeLayout。 RelativeLayout的宽度/高度为fill_parent,FrameLayout的宽度为fill_parent,高度为445dp,因为这是从父级底部到TabWidget底部的高度。

那么,我怎样才能设置FrameLayout总是去只有标签?(我需要它来调整大小以适应任何DPI /屏幕尺寸它显示在)

XML:

<?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"> 

<TabWidget 
    android:id="@android:id/tabs" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 
</TabWidget> 

<FrameLayout 
    android:id="@android:id/tabcontent" 
    android:layout_width="fill_parent" 
    android:layout_height="445dp" 
    android:layout_gravity="bottom" > 

    <RelativeLayout 
android:id="@+id/layout" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:layout_gravity="bottom" > 

    </RelativeLayout> 


</FrameLayout> 




</TabHost> 

回答

1

这将工作....

android:layout_marginTop="63dp" 
android:layout_height="fill_parent" 
+0

谢谢你,那工作。 – Cole 2012-03-09 22:45:20