Skip to content

Instantly share code, notes, and snippets.

@tfcporciuncula
Created February 6, 2019 17:48
Show Gist options
  • Save tfcporciuncula/cd5ae6441b8acd15efd1b7a029e188da to your computer and use it in GitHub Desktop.
Save tfcporciuncula/cd5ae6441b8acd15efd1b7a029e188da to your computer and use it in GitHub Desktop.
Autosizing and word splitting
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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/textView"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:background="@color/colorAccent"
android:ellipsize="end"
android:text="@string/magnanimous"
android:textColor="@android:color/white"
app:autoSizeMaxTextSize="60dp"
app:autoSizeMinTextSize="1dp"
app:autoSizeTextType="uniform" />
</FrameLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment