Reputation: 2815
I have a layout with a TabHost/TabWidget like this:
The blue box is a FrameLayout. I have a RelativeLayout inside the FrameLayout. The RelativeLayout is at fill_parent for width/height and the FrameLayout is at fill_parent width and 445dp height since that's the height from the bottom of the Parent to the bottom of the TabWidget.
So how can I set the FrameLayout to always go only up to the Tabs? (I need it to resize to fit whatever DPI/screen size it's being displayed in)
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>
Upvotes: 0
Views: 1060
Reputation: 11508
This will work....
android:layout_marginTop="63dp"
android:layout_height="fill_parent"
Upvotes: 1