view page 布局tab

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34351732/article/details/85759049
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"  要传的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>

猜你喜欢

转载自blog.csdn.net/qq_34351732/article/details/85759049