Android Fill TextView (Auto Adjust TextSize)

Jul 5, 2019
app:autoSizeTextType="uniform"
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:id="@+id/contentTextView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:autoSizeTextType="uniform"
        app:autoSizeMinTextSize="20sp"
        app:autoSizeMaxTextSize="36sp"
        app:autoSizeStepGranularity="4sp"
        android:gravity="center_vertical"
        />
</LinearLayout>

References:

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.