Best way to implement tabs in android?

后端 未结 3 1393
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 00:41

I have read looked through some code that implements tabs on the bottom of the app\'s page. And there is no deprecated method/class inside the code, and to me it is a very e

相关标签:
3条回答
  • 2020-12-04 01:18

    A Fragment represents a behavior or a portion of user interface in an Activity.

    The android developer guide.

    Your question seems to be worded a little strangely. You are asking about Tabs being at the bottom of the page but asking if you should use Fragments. Those are two different topics.

    Yes, you should use Fragments, it is the route android is taking and will continue to take for the future.

    Having Tabs at the bottom of the screen or at the top is a design decision. Depends on what would be more comfortable for the user experience, really doesn't have a lot to do with Fragments.

    0 讨论(0)
  • 2020-12-04 01:20

    Google has introduced a new View called BottomNavigationView, a standard Bottom Navigation bar for android applications. As per guidelines you can add upto 5 (standard) items and pretty much simple as android's NavigationView.

    Please do visit Component Guidelines, to know more about designing.

    0 讨论(0)
  • 2020-12-04 01:27

    A TabHost cannot contain fragments (well, it can but it's really tricky) so I wouldn't recommend to use it today.

    Fragments are the way to go, and if you want to implement the new Tab mechanism (which is integrated to the "new" ActionBar available on Android 3.0) and still support old android versions there is ActionBarSherlock, an open-source project which facilitate the use of the action bar design pattern across all versions of Android with a single API.

    A lot of popular apps uses this project nowadays (including Google apps) so it's worth looking at.

    0 讨论(0)
提交回复
热议问题