我正在为各种屏幕尺寸设计我的应用程序,但是遇到了一个小问题。我无法更改选项卡内部文本的大小。以下是我的操作步骤:
首先,我创建了自己的样式。
<style name="MineCustomTabText" parent="TextAppearance.Design.Tab">
<item name="android:textSize">22sp</item>
</style>
然后我将此样式应用于适当的XML文件。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="manutd.football.app.interviews.InterviewsActivity">
<manutd.football.app.SlidingTabLayout
android:id="@+id/tabs"
app:tabTextAppearance="@style/MineCustomTabText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:elevation="2dp"
android:background="#656e99" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_below="@+id/tabs"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:layout_weight="1"
></android.support.v4.view.ViewPager>
</RelativeLayout>
有什么想法吗?谢谢