I need to migrate an iOS App to android, and I'm new to Android, I'm not sure what is the best layout design for the app:
- Tab bar(with buttons on it) always on bottom of screen
- Each tab buttons corresponds to a screen, and each screen has a sub screen hierarchy
For example: Tab Button: Shops Screen shows: a list of shops Click on a shop: transition to shop details with address, website etc Click on address in shop detail screen: transition to map
Currently I have a TabActivity, each tab button is associated with an Activity for that button's function, inside each Activity开发者_如何学编程, I have a ViewGroup that contains a fragment, so I can replace current fragment with new one for screen transition(I tried creating new Activity but the tab bar disappears). I don't know if this is the best way to design it, or is there any better approach?
I believe what you want is a TabHost
to handle the different activities: http://developer.android.com/reference/android/widget/TabHost.html
Check the tab layout example at the dev guide: http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
Using Fragment
s will prevent you to deploy the app to any device < HoneyComb.
精彩评论