该应用程序的最佳布局设计(带有屏幕转换的标签栏)?
我需要将 iOS 应用程序迁移到 Android,而且我是 Android 新手,我不确定该应用程序的最佳布局设计是什么:
- 选项卡栏(上面有按钮)始终位于屏幕底部
- 每个选项卡按钮对应到一个屏幕,每个屏幕都有一个子屏幕层次结构
例如: 选项卡按钮:商店 屏幕显示:商店列表 点击商店:转至商店详细信息,包括地址、网站等 单击商店详细信息屏幕中的地址:转换到地图
当前我有一个 TabActivity,每个选项卡按钮都与该按钮功能的一个 Activity 相关联,在每个 Activity 内,我有一个包含片段的 ViewGroup,因此我可以将当前片段替换为用于屏幕转换的新活动(我尝试创建新活动,但选项卡栏消失了)。我不知道这是否是最好的设计方法,或者还有更好的方法吗?
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?
我相信您想要的是一个
TabHost
来处理不同的活动: http://developer.android.com/reference/android/widget/TabHost.html在开发指南中查看选项卡布局示例:http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
使用
Fragments 将阻止您将应用程序部署到任何设备 <蜂窝。
I believe what you want is a
TabHost
to handle the different activities: http://developer.android.com/reference/android/widget/TabHost.htmlCheck 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.