How to increase the font size of an EditText according to the size of the screen?

5

I would like the font size to be proportional to the screen size of the device that will run the application.

    
asked by anonymous 03.03.2015 / 15:05

1 answer

3

You can create a dimens.xml file for each type / screen resolution:

1) Create a values folder for the resolutions you want to handle individually, eg values-hdpi , values-mdpi etc.

2) Within the file dimens.xml of each folder create a dimen item (with the same name in all):

<dimen name="txt_size">12sp</dimen>

3) Now, within your EditText :

android:textSize="@dimen/txt_size"

You can check the complete list of resolutions through official documentation: link

    
03.03.2015 / 15:17