How To Use Custom Iphone Tab In Fragmentactivity?
I am new in Android and I tried to create a tab using FragmentActivity from codes that I found online. http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way
Solution 1:
Solved it! Finally! After testing other resources that I referred to, I realized that layout_alignParentBottom in RelativeLayout does not give any outcome. Hence I tried aligning the TabWidget to the bottom instead, and it worked!
This is my main.xml that contain TabHost and TabWidget. http://pastie.org/pastes/5188297/text?key=lqfp3jnofs5kgsvslm3yg
Keep the tab_indicator.xml / the settings for the text and image like this : http://pastie.org/pastes/5187408/text?key=qxxa5xxrhsburebllyhmw
And here is the a custom iPhone tab that uses FragmentActivity :
P/S : Sorry if my Java file is confusing, I'm new and if there is anything I did wrong, do tell me.
Solution 2:
try this Honey >
<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="55dp"android:layout_weight="1"android:orientation="vertical"android:layout_gravity="bottom"android:background="@android:drawable/title_bar"android:padding="5dp"><TextViewandroid:id="@+id/title"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentBottom="true"android:layout_centerHorizontal="true"style="?android:attr/tabWidgetStyle"/><ImageViewandroid:id="@+id/icon"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentLeft="true"android:layout_centerVertical="true"android:src="@drawable/ic_action_search" /><ImageViewandroid:id="@+id/icon"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_alignParentLeft="true"android:layout_centerVertical="true"android:layout_marginLeft="49dp"android:src="@drawable/ic_action_search" /></RelativeLayout>
Post a Comment for "How To Use Custom Iphone Tab In Fragmentactivity?"