Pages
iPhone-Like Tab bar in Android
9:58 PM
Posted by Mina Samy
but what if we want to give the tabs the look of the iPhone Tab Bar ?
this is possible by wrapping the TabWidget and the FrameLayout in a RelativeLayout container and adding android:layout_alignParentBottom="true" attribute to the TabWidget just like this:
<?xml version="1.0" encoding="utf-8"?>
<TabHost android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabhost"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TabWidget
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@android:id/tabs"
android:layout_alignParentBottom="true"
/>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@android:id/tabcontent"
>
</FrameLayout>
</RelativeLayout>
</TabHost>
| Reactions: |
This entry was posted on October 4, 2009 at 12:14 pm, and is filed under
iPhone,
Tabs
. Follow any responses to this post through RSS. You can leave a response, or trackback from your own site.
Subscribe to:
Post Comments (Atom)










Post a Comment