android--tabhost
来源:互联网 发布:淘宝店铺标志怎么删除 编辑:程序博客网 时间:2024/04/28 09:02
改变选项卡的内容和内容的 可以再布局文件tabhost 使用相对布局 控制framLayout 与TabWidget的位置
main.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /> <TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="wrap_content" > <!-- 控制选项卡的内容 --> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" > </TabWidget> <!-- FrameLayout 里面所显示的内容是activity的内容 --> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="wrap_content" > </FrameLayout> </TabHost></LinearLayout>
public class TabhostActivity extends TabActivity {private TabHost tab;private TabSpec labe1;/** Called when the activity is first created. */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);tab = this.getTabHost();settingTab();}// 设置选项卡private void settingTab() {//添加一个选项卡labe1 = tab.newTabSpec("标签1");// 设置选项卡内容labe1.setIndicator("标签1",getResources().getDrawable(R.drawable.ic_launcher));Intent view1 = new Intent();view1.setClass(this, OneActivity.class);// 必须要添加内容labe1.setContent(view1); // 选项卡要添加到tabhost上tab.addTab(labe1);}}
- Android tabhost
- Android:TabHost
- TabHost Android
- Android TabHost
- Android TabHost
- android--tabhost
- android tabhost
- android Tabhost
- Android TabHost
- android tabhost
- Android TabHost
- android TabHost
- android:Tabhost
- Android --- TabHost
- Android:TabHost
- Android TabHost
- android tabhost
- android TabHost
- kvm-kmod目录结构与编译依赖
- Broadcastreceiver onreceive函数重复调用
- JDBC创建
- 编程珠玑第一章 习题2,习题9
- Eclipse Debug模式无法启动
- android--tabhost
- 解决system.data.oracle client要求8.1或者8.7以上的版本的方法
- 给IT新男的15点建议:苦逼程序员的辛酸反省与总结
- 【SHELL】1 FTP脚本
- ModBus通信系统协议
- archlinux 的一些自动加载项
- SIFT/SURF算法的深入剖析——谈SIFT的精妙与不足 .
- 面向对象的 单例模式
- office2010excel在第一次打开时,会出现“向程序发送命令时出现错误”