Reputation: 3095
I have a tabbar application with the tab at the top. My second tab is a list view. When i select an item in the list view , it should open other list view. But the new list view should not take up the whole screen but should be confined below the tab bar ? How to go about doing this?
Upvotes: 0
Views: 213
Reputation: 1072
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="vertical"
android:weightSum="100" >
<!-- Some code here you want -->
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="2dp"
android:background="#ffffff"
android:layout_weight="50">
</ListView>
<!-- here choose different values layout_weight according to your desire it work 100% -->
Upvotes: 0
Reputation: 4381
I find the best way is to use a vertical linear layout as your container. Set the layout height of the tab bar to wrap content and the list layout height to fill parent with a layout weight of 1.
Upvotes: 1