2

I want to create the following layout - an activity with a viewpager along with a tab that stays that the bottom of the activity to indicate which of the 4 fragments the user is in (and the selected tab gets highlighted by an 'active colour')

enter image description here

I've spent some time looking at various resources online to add this tab.

http://developer.android.com/training/implementing-navigation/lateral.html#tabs - this looked like it would work well until I found out that actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); is deprecated

I looked here however, it is the same solution (i.e. deprecated)

I looked here however, the PagerTitleStrip shows one tab (and partly the adjacent tabs) while I want to see all the tabs (there are no partially hidden tabs as in the picture)

Is there a tutorial that explains how to achieve this? It is one of the most basic UI elements, so I am hoping I am not finding the best solution

4

1 回答 1

0

我一直在寻找相同的东西,我看到了这个问题,在这个答案中,OP 说

这违反了Android设计指南,因为底部有软/硬按钮,如后退按钮主页按钮等。

http://developer.android.com/design/patterns/pure-android.html

但是如果你坚持把它们放在底部,你可以像 GitHub 示例一样使用 FragmentTabHost 来实现它,在底部包含选项卡。

https://github.com/rameshkec85/BottomTabsFragmentTabHost

所以即使我也在考虑。

于 2015-04-08T09:45:06.037 回答