先上结果截图:
接下来讲怎么做,很简单,两步即可:
1.新建一个选项卡的class继承TabActivity,新建一个对应的xml,xml里面加入三个layout。
为啥要新建三个layout呢?因为我的选项卡要三个界面,所以要新建三个layout,根据每个layout的id,可以将其与选项卡绑定,做成三个选项卡界面。
我的xml代码如下:
<?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" >
<LinearLayout
android:id="@+id/tab01"
android:orientatio