Problem with EditText text size

I am trying to set a lower EditText height but still failed. Here is my source:

<EditText android:layout_width="150dp" android:layout_height="20dp"
      android:singleLine="true" android:textSize="10dp" />

This code cuts out the text, and a white rectangular shape appears around the EditText control. I also tried maxHeight / minHeight properties, but did not work. If someone has solved this problem, please help.

Or is it an error in the android? I can’t even resize Spinner, just like with EditText.

thank

Irfan

+3
source share
1 answer

Probably you see fancy orange rectangular shapes inside the box when testing in the emulator?

, . textSize . 30dp.

, "dp" , EditText.

textSize x 3 = layout_height

, "breaks" 29dp. , , textSize = "10dp", layout_height = "30dp", textSize = "12dp", layout_height = "36dp". , , 9dp. , relative_layouts .

+5

Source: https://habr.com/ru/post/1778609/


All Articles