Prabhjot Singh
Prabhjot Singh

Reputation: 526

Need Swipe tab bar position but not in the action bar

I am trying to implement the tabs somewhere in the screen but not at the top as displayed in the screenshot.

enter image description here

I tried action bar tabs but these tabs always attached to action bar i.e at the top of screen. How can i use TABS below the image as shown the screenshot.

Thanks

Upvotes: 0

Views: 185

Answers (1)

mmlooloo
mmlooloo

Reputation: 18977

you can try this:

PagerSlidingTabStrip

or if you want to have a google one you can try:

PagerTabStrip

the implementation of the first one is straight forward and explained in the link for the second one copy the java files from view folder and add them to your project and the rest of the work is similar to the first one.

in xml:

    <com.example.android.common.view.SlidingTabLayout
          android:id="@+id/sliding_tabs"
          android:layout_width="match_parent"
          android:layout_height="wrap_content" />

and then you can use ViewPager to change the views.

Upvotes: 1

Related Questions