FragmentTabHost是support-v包下提供的用于集成和管理Fragment页面的组件.

今天要实现的效果图如下:
整体结构是MainActivity+5个模块的Fragment.
MainActivity的布局如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--真正的内容视图,用于展示Fragment-->
<FrameLayout
android:id="@+id/real_tabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<!--tabhost,必须使用系统的id-->
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<!--tabcontent,必须使用系统的id-->
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="0"/>
</android.support.v4.app.FragmentTabHost>
</LinearLayout>