Reputation: 301
How can i create a design like below:
----------------------
|Tab 1 | Tab 2 | tab 3 |
-----------------------
| Sub tab 1 | Sub tab 2|
----------------------
Below is the approach that i am following, but i dont know how to create second level tab:
<android.support.v4.view.ViewPager
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.PagerTitleStrip
android:id="@+id/pager_title_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#33b5e5"
android:textColor="#fff"
android:paddingTop="4dp"
android:paddingBottom="4dp" />
</android.support.v4.view.PagerTitleStrip>
</android.support.v4.view.ViewPager>
Upvotes: 1
Views: 540
Reputation: 38585
You can put a TabHost in the Fragment whose content needs the sub-tabs. Or you can change your application's navigation to not have stacked tabs (which looks ugly)
Upvotes: 1