Android中TabHost部件使用
来源:互联网 发布:网络电视直播客户端 编辑:程序博客网 时间:2024/05/15 23:47
其效果图:
下面就是创建 Activity类 来实现 其功能:
public class MainActivity extends TabActivity {public TabHost tabHost;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);// 获取对象tabHost = getTabHost();TabSpec nearby_tab = tabHost.newTabSpec("nearby_tab");TabSpec history_tab = tabHost.newTabSpec("history_tab");TabSpec about_tab = tabHost.newTabSpec("about_tab");nearby_tab.setIndicator("优酷首页",getResources().getDrawable(R.drawable.tab_home_selected)).setContent(new Intent(this, MyCenterActivity.class));history_tab.setIndicator("频道中心",getResources().getDrawable(R.drawable.tab_category_selected)).setContent(new Intent(this, MyIndexActivity.class));about_tab.setIndicator("个人中心",getResources().getDrawable(R.drawable.tab_usercenter_select)).setContent(new Intent(this, MySelfActivity.class));tabHost.addTab(nearby_tab);tabHost.addTab(history_tab);tabHost.addTab(about_tab);}@Overridepublic boolean onCreateOptionsMenu(Menu menu) {// Inflate the menu; this adds items to the action bar if it is present.getMenuInflater().inflate(R.menu.main, menu);return true;}}
- Android中TabHost部件使用
- android Tabhost部件
- android Tabhost部件(详细)
- android Tabhost部件
- Android Tabhost部件
- android Tabhost部件(一)
- android Tabhost部件(二)
- Android中使用tabhost
- android Tabhost部件(三)--使用自定义view和fragement实现类似TabHost样式
- 【android】ViewGroup中使用TabHost
- Android中TabHost的使用
- Android中TabHost的使用
- android中tabhost的使用
- android Tabhost部件(四)--其他类似TabHost实现
- Android中TabHost嵌套TabHost
- Android中Tab与TabHost的使用
- Android中TabHost的原理及使用
- android中TabHost+intent的使用
- 最长回文子串
- 【第三章】 DI 之 3.1 DI的配置使用 ——跟我学spring3
- 一步一步实现MFC扩展DLL中导出类和对话框
- JavaScript学习笔记(三十一) 经典继承模式
- VC6的2003年2月份SDK更新下载地址
- Android中TabHost部件使用
- ajax学习8
- Felt It
- IOS后台运行机制详解(二)
- 【第三章】 DI 之 3.2 循环依赖 ——跟我学spring3
- eclipse调试技巧10个!(转)
- jQuery插件开发 - 其实很简单
- 如何让用户看不到错误页面或者显示指定页面
- Android中如何制作游戏的启动菜单