[英]Fit text into an EditText Android
我正在使用EditText
通过editText.setText(string)
放置特定文本,我试图将EditText
的高度与String的行匹配,但是我不能。
如果我使用EditText
并正常书写,则效果很好,但是我需要使用setText()
放置文本。
有人能帮我吗?
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="false"
android:id="@+id/text_description"
android:maxLength="500"
android:focusableInTouchMode="false"
android:layout_weight="0" />
在您的XML文件中,将android:layout_height
属性设置为wrap_content
如下所示:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
...../>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.