您的位置:首页 > 其它

tablayout布局,字体大小

2017-09-18 13:42 344 查看
<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>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: