android开发之TabHost选项卡
来源:互联网 发布:bangbangbangmv知乎 编辑:程序博客网 时间:2024/05/27 20:50
TabHost选项卡的简单操作
//.xml
<TabHost android:id="@android:id/tabhost" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="497dp"> </FrameLayout> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="50dp"/> </LinearLayout></TabHost>
//.java
public class MainActivity extends TabActivity { TabHost tabHost;// TabHost.TabSpec TabSpecA,TabSpecB,TabSpecC; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tabHost=getTabHost(); TabSpecA=tabHost.newTabSpec("tab1"); TabSpecA.setIndicator("Tab01"); Intent intent_1=new Intent(this,Tab1_Activity.class); TabSpecA.setContent(intent_1); TabSpecB=tabHost.newTabSpec("tab2"); TabSpecB.setIndicator("Tab02"); Intent intent_2=new Intent(this,Tab2_Activity.class); TabSpecB.setContent(intent_2); TabSpecC=tabHost.newTabSpec("tab3"); TabSpecC.setIndicator("Tab03"); Intent intent_3=new Intent(this,Tab3_Activity.class); TabSpecC.setContent(intent_3); tabHost.addTab(TabSpecA); tabHost.addTab(TabSpecB); tabHost.addTab(TabSpecC); }}
阅读全文
1 0
- android开发之TabHost选项卡
- android 选项卡TabHost
- android 选项卡TabHost
- 【Android 应用开发】Android - TabHost 选项卡功能用法详解
- android 选项卡(TabHost) 置底
- android 底部选项卡(TabHost)
- Android TabHost选项卡编程
- android TabHost选项卡示例
- android中tabhost选项卡
- android tabHost选项卡自定义
- Android TabHost 选项卡用法
- Android开发之TabHost
- Android之玩转选项卡(TabHost、TabWidget、FrameLayout)
- Android控件开发之TabHost
- Android学习笔记-TabHost选项卡使用
- android - 制作底部选项卡TabHost
- Android学习笔记-TabHost选项卡使用
- 浅谈android的选项卡TabHost
- 查看进程打开的文件和文件被哪些进程打开
- HTML第一个节点学习笔记
- 2017年河北省大学生程序设计竞赛 奇妙糖果屋 【二进制+异或】
- hibernate 懒加载问题
- 二维/多维vector在未知维度的前提下的赋值操作
- android开发之TabHost选项卡
- 克鲁斯卡尔最短路径算法详解
- fork的数据是否共享
- 2012.B组 方阵旋转
- golang-redis之sorted set类型简单操作
- linux鸟哥视频学习笔记02
- 开发环境的注意
- java新特性—泛型
- linux高性能服务器编程学习笔记一:TCP/IP协议详解