添加tab标签
来源:互联网 发布:c语言清华大学出版社 编辑:程序博客网 时间:2024/05/16 14:57
1.xml
<TabHost android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/show"> <LinearLayout android:id="@+id/tab1" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/text_tab1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="favorite" /> </LinearLayout> <LinearLayout android:id="@+id/tab2" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/text_tab2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="contacts" /> </LinearLayout> </TabHost>
2.代码
public class PeopleActivity extends TabActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().requestFeature(Window.FEATURE_NO_TITLE); //setContentView(R.layout.activity_main); TabHost tabHost = getTabHost(); LayoutInflater.from(this).inflate(R.layout.activity_main, tabHost.getTabContentView(),true); tabHost.addTab(tabHost.newTabSpec("tab1") .setIndicator("contacts") .setContent(R.id.tab1)); tabHost.addTab(tabHost.newTabSpec("tab2") .setIndicator("chat") .setContent(R.id.tab2)); }
0 0
- 添加tab标签
- Layout中添加tab标签
- bootstrap:动态添加tab标签
- VC TAB标签上添加图标
- openwrt添加 删除tab标签元素
- 183.m1-ActionBar2添加tab标签
- Tab标签
- tab标签
- tab标签
- Tab标签
- ExtJS动态添加和删除tab标签实例
- 为EasyUI 的Tab 标签添加右键菜单(转)
- ditchnet-tab标签
- TAB标签效果
- VC 标签TAB使用
- VIM 标签页 (tab)
- javascript的tab标签
- tab标签页
- 【数据结构】排序算法总结
- 天下3内测绝版序列号
- 致网友Wonderfei的一封信(如何选择自动化框架的几点拙见)
- android menu 基础
- 简单利用viewpagerindicator的两个类,而非整个工程实现程序引导页
- 添加tab标签
- XML格式统一解析
- USACO 1.3.6 Ski Course Design
- hibernate事物管理
- nodejs
- 基于构建实时WEb应用的HTML5 WebSocket协议<一>
- 基础算法系列(十二)排序算法之基数排序
- UVA - 10491 Cows and Cars 概率
- move设计模式