How can I change the font size in Android Studio?

Tags: , , , ,



I don’t want to change the font size of Android Studio itself, but rather the font size of the app i’m working on. All the search results I have found talk about the user interface or zooming in.

I’m Working on a tic-tac-toe beginner project and the button text always is so small. Any tips on how to increase it?

Here is its part in the xml file:

    <Button
        android:id="@+id/button_0"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
    />

Click to see the image

Many thanks in advance for anyone who helps

Answer

Add android:textSize property into Button, eg:

<Button
 android:id="@+id/button_0"
 android:layout_width="0dp"
 android:textSize="20sp"
 android:layout_height="match_parent"
 android:layout_weight="1"
 />

https://developer.android.com/reference/android/widget/TextView#attr_android:textSize



Source: stackoverflow