<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android"    android:id="@android:id/tabhost"    android:layout_width="match_parent"    android:layout_height="match_parent" >    <LinearLayout         android:layout_width="fill_parent"        android:layout_height="fill_parent"        android:orientation="vertical">        <TabWidget             android:id="@android:id/tabs"            android:layout_width="fill_parent"            android:layout_height="fill_parent"/>        <FrameLayout             android:id="@android:id/tabcontent"            android:layout_width="fill_parent"            android:layout_height="fill_parent">            <!-- 定义第一个标签页 -->            <LinearLayout                 android:id="@+id/tab01"                android:layout_width="fill_parent"                android:layout_height="fill_parent"                android:orientation="vertical"></LinearLayout>            <!-- 定义第二个标签页 -->            <LinearLayout                 android:id="@+id/tab02"                android:layout_width="fill_parent"                android:layout_height="fill_parent"                android:orientation="vertical"></LinearLayout>            <!-- 定义第三个标签页 -->            <LinearLayout                 android:id="@+id/tab03"                android:layout_width="fill_parent"                android:layout_height="fill_parent"                android:orientation="vertical"></LinearLayout>        </FrameLayout>    </LinearLayout></TabHost>

注意:

TabHost的ID应该为@android:id/tabhos

TabWidget的ID应该为@android:id/tabs

FrameLayout的ID应该为@android:id/tabcontent


Android平台不推荐使用TabActivity。而是推荐使用Fragment

更多相关文章

  1. AndroidStudio出现tools:replace="android: authorities",tools:r
  2. Android的关键的持久数据应该在onPause()方法中保存
  3. android viewPage 判断是否到最后一页
  4. Android(安卓)官方文档:(二)应用清单 —— 2.2 <action>标签
  5. Android高手进阶教程(二十七)之---基于ViewFlipper实现的自定义
  6. Android应用程序键盘(Keyboard)消息处理机制分析(10)
  7. Android(安卓)中自定义View的应用
  8. Android(安卓)自定义键盘中禁用点击预览弹窗
  9. android-控件样式(Theme)自定义

随机推荐

  1. android 带文字的ImageButton
  2. ch028 Android(安卓)断点续传
  3. Android(安卓)之 五大布局案例
  4. 自定义动画(animation)时set中的各元素效
  5. android dumpsys
  6. Android日记抓取并保存
  7. Android(安卓)控件使用参数集锦
  8. Android控件笔记——在界面中显示及输入
  9. Android(安卓)API中文文档Button
  10. 相对布局相关属性