How do I prevent an EditText from resizing itself when the user is typing?

前端 未结 10 2000
粉色の甜心
粉色の甜心 2021-01-30 16:18

I have an EditText and a Button set next to each other on the same horizontal line. It looks great, except when the user enters a lot of text, the

10条回答
  •  旧巷少年郎
    2021-01-30 16:50

    The chosen solution works, but let me add a little complement:
    if you use android:layout_weight="0.15" (the value is not important)
    then
    android:layout_width="0dp" if the LinearLayout is Horizontal
    or
    android:layout_height="0dp" if the LinearLayout is Vertical.

提交回复
热议问题