先贴图看效果 Activity代码:
1.没有使用TabActivity,这是在3.0中不建议使用的。 2.setContent()函数除了直接添加视图ID,还可以添加intent直接在Tab的内容部分打开一个activity。如需要了解详细实现过程可自行搜索,也可以发邮件至我的邮箱jayzhou215@163.com 3.重载onTabChanged(String tabId) 函数的目的是实现按下面按钮时变蓝的效果,具体请查看源码 4.之所以菜单栏会在底部显示是在TabHost和TabWidget之间加了一层RelativeLayout,将TabWidget设置为alignParentBottom即可。 main.xml源码:
|
底部菜单栏
最新推荐文章于 2024-08-07 22:38:02 发布
先贴图看效果 Activity代码: 一些注意点: 1.没有使用TabActivity,这是在3.0中不建议使用的。 2.setContent()函数除了直接添加视图ID,还可以添加intent直接在Tab的内容部分打开一个activity。如需要了解详细实现过程可自行搜索,也可以发邮件至我的邮箱jayzhou215@163.com 3.重载onTabChanged(String tabId) 函数的目的是实现按下面按钮时变蓝的效果,具体请查看源码 4.之所以菜单栏会在底部显示是在TabHost和TabWidget之间加了一层RelativeLayout,将TabWidget设置为alignParentBottom即可。 main.xml源码: |