【问题标题】:how to change the default height of the edittext to small? [closed]如何将edittext的默认高度更改为小? [关闭]
【发布时间】:2012-01-05 06:42:58
【问题描述】:

我在我的应用程序中使用 Edittext,但想调整它的大小,请告诉我该怎么做?

    <EditText android:layout_width="200dip"
              android:layout_height="wrap_content"
              android:singleLine="true"/>

【问题讨论】:

  • 调整大小是什么意思?实际要求是什么?说清楚。
  • 为什么要调整大小,然后添加为你想要的字符
  • 这是我的编辑文本代码 但因为我在我想要的活动中使用了许多编辑文本它们的尺寸很小,所以想调整它的大小!

标签: android resize android-edittext


【解决方案1】:

要获得更小的编辑文本,请在 android:layout_width 中使用更小的倾角值

android:layout_width="200dip"   EditText with bigger width
android:layout_width="150dip"   EditText with smaller width than above
android:layout_width="100dip"   EditText with smaller width than above
android:layout_width="50dip"   EditText with smaller width than above
...
..
android:layout_width="0dip"   EditText with width 0 you cant see this edittext

将 EditText 宽度设置为您要设置的适当大小

【讨论】:

  • @Down 选民。请努力提及拒绝投票的原因,这将有助于其他开发人员了解拒绝投票的确切原因。不要隐藏自己和原因。
  • -先生,我想将edittext的默认高度改为小而不是宽度!!!
  • 类似的事情你可以通过设置 android:layout_height="50dip" 的值来设置 EditText Height 等等
【解决方案2】:
<EditText
    android:layout_width="20dp"
    android:layout_height="20dp"/>

将“20”替换为您想要的大小。数字越大 = 越大

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-07
    • 2014-07-09
    • 1970-01-01
    • 2016-09-29
    相关资源
    最近更新 更多