EditText Height Issue

◇◆丶佛笑我妖孽 提交于 2019-12-04 12:52:26

You are probably seeing bizarre orange rectangular shapes within the field when testing in the emulator ?

If so then I have managed to work out some basic rule-of-thumb on size settings. Your textSize needs to be a little bigger. Try 30dp.

With some experimentation I have found that if you use "dp" and apply this rule of thumb, it should work for EditText fields.

textSize x 3= layout_height

I say rule of thumb because the minimum height before the field "breaks" again is about 29dp. So, for example if you have textSize="10dp", then layout_height="30dp", or textSize="12dp", then layout_height="36dp". You can have smaller textSizes, but it becomes illegible lower than 9dp. I found this works well in relative_layouts with default fonts.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!