tablayout布局,字体大小

来源:互联网 发布:windows会员计划 编辑:程序博客网 时间:2024/06/03 22:18




<android.support.design.widget.TabLayout    android:layout_width="match_parent"    android:layout_height="50dp"    android:id="@+id/tab_layout"    app:tabGravity="center"    app:tabMode="scrollable"    app:tabTextColor="#000000"    app:tabTextAppearance="@style/tablayoutTextSize"    app:tabSelectedTextColor="#ff0000"    app:tabIndicatorColor="#ff0000"    ></android.support.design.widget.TabLayout> 设置字体styles.xml里面
<resources>    <!-- Base application theme. -->    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">        <!-- Customize your theme here. -->        <item name="colorPrimary">@color/colorPrimary</item>        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>        <item name="colorAccent">@color/colorAccent</item>    </style>    <style name="quanping" parent="Theme.AppCompat.Light.NoActionBar"></style>    <style name="tablayoutTextSize">        <item name="android:textSize">@dimen/text_20_sp</item>    </style></resources>

dimens.xml里面

<resources>    <!-- Default screen margins, per the Android Design guidelines. -->    <dimen name="activity_horizontal_margin">16dp</dimen>    <dimen name="activity_vertical_margin">16dp</dimen>    <dimen name="text_20_sp">20sp</dimen></resources>


原创粉丝点击