Wie man tablayout text Größe gleich?

Hier ist was ich getan habe: ich erstellt eine Formatvorlage für den text

<!-- Change tab text appearance -->
    <style name="MyCustomTextAppearance" parent="TextAppearance.Design.Tab">
        <item name="textAllCaps">false</item>
        <item name="android:textAppearance">@style/CustomTabWidgetText</item>
    </style>

    <style name="CustomTabWidgetText"
        parent="@android:style/TextAppearance.Widget.TabWidget">
        <item name="android:textSize">16sp</item>
    </style>

dann setze ich es auf meine tablayout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activity.HomeActivity"
    tools:showIn="@layout/app_bar_main">


    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?attr/colorPrimary"
        app:titleTextColor="#ffffff"
        />


    <android.support.design.widget.TabLayout
        android:id="@+id/tab_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/toolbar"
        android:background="?attr/colorPrimary"
        app:tabSelectedTextColor="#ffffff"
        app:tabTextAppearance="@style/MyCustomTextAppearance"
        app:tabTextColor="#ffffff" />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_below="@id/tab_layout" />

</RelativeLayout>

Hier ist das Ergebnis:

Wie man tablayout text Größe gleich?

Wie Sie sehen können, ist der "D-day "abgeschlossen" - text ist kleiner als andere. Ich habe Antrag zu stellen dessen Größe gleich der andere, aber ich weiß nicht, wie. Bitte helfen Sie mir, danke.

Sie können sicher finden Sie hier Ihre Antwort...stackoverflow.com/questions/19442084/...
Der text würde nicht passen, wenn es größer war. Wäre es fix it Sie setzen tabLayout ist tabMode zu app:tabMode="scrollable"? Dann wird vielleicht der ganze text passen würde, und Sie hätten den gleichen text Größe. Das geht in der xml, in der TabLayout tag.
oder wenn Sie eine bekannte Anzahl von Registerkarten, überlegen Sie, ob Sie tabMode fest und verringern die Schriftgröße auf kleineren Breite Bildschirme

InformationsquelleAutor Bụng Bự | 2016-04-04

Schreibe einen Kommentar