最近在做一个项目,要用到七、八个Tab页,想把这七、八个tab页的布局文件单独放在xml文件中,方便管理,找了很多方法,但是实现不了啊,怎么样实现啊?
解决方案 »
- android里sqlite数据库的长度问题
- 求android 应用程序操作串口的方法.
- eclipse 真机调试时,File Exploer下没有文件夹
- 跪求一个 android问题,有关checkbox的
- android的模拟器问题!!!!!!!!!
- android手机适应不同屏幕是不是只需要考虑DPI?
- Android实现自动登录
- android studio中的unexpected end of file 该怎么解决
- android studio:RadioGroup中不选中RadioButton,Switch case结构就没有Default的问题
- NDK 使用Makefile单独编译64位动态链接库的问题
- 解析新浪微博Json字符串显示IllegalStateException
- 100分求助,android调用webservice异常org.xmlpull.v1.XmlPullParserException
Resources resources=getResources();
TabHost tabHost=getTabHost();
TabSpec spec;
Intent intent;
intent=new Intent(this,TabActivity2.class);
spec=tabHost.newTabSpec("tab1")//新建一个tab
.setIndicator("tab1", resources.getDrawable(android.R.drawable.alert_light_frame))//设置名称及图标
.setContent(intent);//设置显示的intent
tabHost.addTab(spec);//添加进tabHost可以啊,每个tab都是一个activity,都有自己的布局