Tabhost / spec vs. viewpage vs tabbed actionbar .. which one?

I was familiar with TabHost / TabSpec for creating a tabbed application. I noticed that there are several options for creating tabs:

1- Tabs in the action bar

2- Viewpager (I think Google calls it horizontal pager)

3- And open the tabhost / tabspec approach.

I tried to read google docs, but it's like everywhere else, so I got even more confused. When will you use what is or is the norm?

thank

+3


source to share


1 answer


You have to use a toolbar with a ViewPager to simulate tabs (they are all wrapped in an AppBarLayout). The result will look something like this: enter image description here

You can read more about this type of design in the Material Design spec: https://www.google.com/design/spec/components/tabs.html#tabs-usage



Also, here's a good guide for implementing tabs in a ViewPager: http://blog.grafixartist.com/material-design-tabs-with-android-design-support-library/

0


source







All Articles