I've seen that PagerTabStrip
is a method of displaying tabs for a ViewPager
. And now that ActionBar
has been deprecated for Toolbar
, it seems that the PagerTabStrip
is my only option.
Except, I only see it comes out in the following style:
I really just want normal tabs (with icons) the way I could do it with the ActionBar before like this:
What is the proper way of doing this now? Should I use an old TabWidget
and add tabs manually? Or is there a way of styling the PagerTabStrip
that I didn't know about?
EDIT: Here's the library I ended up using: https://github.com/neokree/MaterialTabs
Have a look at SlidingTabLayout from Google I/O Android App. It depends on SlidingTabStrip.
You can see how it's used by doing a simple search: you add it to your layout and then just connect it with your ViewPager
like so:
slidingTabLayout.setViewPager(viewPager);
There is a way to setCustomTabView
to customize the tabs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With