I have a edit text layout as below and I want to know, is there any way to provide different size for it for different hardware depending on its screen size? For screens bel
If you use
in a configuration dependent way, you will override default size for all devices (22dp for smaller, 40dp for larger devices). If you want to leave textSize as it was by default for smaller devices, and only override it for larger devices, you can use styles:
res/values/styles.xml:
res/values-large/styles.xml:
And in the layout:
This way textSize
is left untouched for smaller devices, and default value from current theme is used.