private void layoutTab() {
new VP().create(this, getVpFragments(), getTabResId());
}
<LinearLayout // tablayout 组视图
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal"
android:padding="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout //一个tab 布局
android:id="@+id/all_linear" // 要传VP().create 的ID
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textColor="@drawable/text_color_black_2_red_ff5" //选中后改变的视图
android:textSize="24sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="全部"
android:textColor="@drawable/text_color_black_2_red_ff5"
android:textSize="10sp" />
</LinearLayout>