1,主布局文件
<?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:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/activity_viewpager_tab1_tv"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="30dp"
android:gravity="center"
android:text="页签1"/>
<TextView
android:id="@+id/activity_viewpager_tab2_tv"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="30dp"
android:gravity="center"
android:text="页签2"/>
<TextView
android:id="@+id/activity_viewpager_tab3_tv"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="30dp"
android:gravity="center"
android:text="页签3"/>
</LinearLayout>
<!-- 滑动选中动画 -->
<ImageView
android:id="@+id/cursor"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="matrix"
android:src="@drawable/tab_scoll_bar"
/>
<!-- viewPager -->