问题
In my app i want to have tabs in the middle of the screen and a gMap at the top is there anyway to position the tabs in the middle of the screen?
Here is a raw design
(source: qnex.me)
回答1:
You can use ViewPagerIndicator library (using TabPageIndicator control) with a ViewPager control, and these are completely separate from the ActionBar and can be positioned anywhere you like. Download the source and check out the sample app. The code is very straightforward.
Here's an example straight from the source of the sample app
https://github.com/JakeWharton/Android-ViewPagerIndicator/blob/master/sample/res/layout/simple_tabs.xml
来源:https://stackoverflow.com/questions/14348816/android-navigation-tabs-in-middle-of-screen