Best way to implement tabs in android?

后端 未结 3 1392
佛祖请我去吃肉
佛祖请我去吃肉 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: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.

提交回复
热议问题