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
  • 2,022
  • 16
  • 34

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
  • 74,896
  • 15
  • 165
  • 198
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,613
  • 1
  • 16
  • 26