Fragment Tab header/label size

encossisa

New Member
I am sure it needs a simple flag but I am not finding the correct one, spent at least 2 hours to find a correct solution. Hope to get help from you guru's.I am trying to create a two tab layout using fragmentActivity. I want to give 50% screen space to each tab. I am able to do that (see attached Screen shot) the next hurdle is I want the tab header e.g. Financial with black bkg should take 50% and Others with gary bkg to take remaining 50%.
PnB8G.png
I hope I am clear with my question. :-)\[code\]attaching my 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" android:background="#EFEFEF" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="wrap_content" > <FrameLayout android:id="@+id/financial" android:layout_width="0dp" android:layout_height="0dp" android:layout_weight="0" android:tag="@string/financial" /> <FrameLayout android:id="@+id/other" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" android:tag="@string/others" /> </FrameLayout> </RelativeLayout></TabHost>**The calling xml would be**<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" > <ListView android:id="@+id/listView1" android:layout_width="fill_parent" android:layout_height="48dp" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" > </ListView> <fragment class="com.......android.activity.AccountsTab" android:id="@+id/tabs_fragment" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_centerInParent="true"/></RelativeLayout>\[/code\]adding tab.xml\[code\]<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="150dp" android:layout_height="@dimen/tab_height" android:background="@drawable/tab_selector" android:gravity="center_horizontal" android:orientation="horizontal" android:padding="@dimen/tab_padding" android:weightSum="0.5" > <TextView android:id="@+id/text" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0.5" android:gravity="center_horizontal|center_vertical" android:textColor="@drawable/tab_text_selector" android:textSize="@dimen/text_default" android:textStyle="italic" /></RelativeLayout>\[/code\]
 
Back
Top