I would like the font size to be proportional to the screen size of the device that will run the application.
I would like the font size to be proportional to the screen size of the device that will run the application.
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