0

I am making Game with android studio everything is completed but only one issue i have. Text size's not changed. How to make it for auto fit on any screen like phones and tablets.

Sabish.M
  • 1,912
  • 12
  • 28

2 Answers2

1

Try this Demo Git Project Android-autofittextview.It may help you.In your layout add like this to mention size android:textSize="@dimen/_15sdp".

IntelliJ Amiya
  • 73,189
  • 14
  • 161
  • 193
0

you can use this library to auto fit your text depend on TextView width.
also you need to set android:textSize in dimens.xml like this:

<TextView
    android:id="@+id/textview"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="@dimen/textsize"/>

for have different size for different devices just define dimens.xml for different screen size (for example: Value-large)

MHP
  • 2,460
  • 1
  • 14
  • 25