我希望文本区域的高度为 5 行。我正在使用以下代码。
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:singleLine="false"
android:lines="5"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip" />
文本区域看起来不错,但问题是光标在文本字段的中间闪烁。我希望它在第一行,文本字段的第一个字符处闪烁。
最佳答案
使用 android:gravity="top"
关于Android:多行EditText(文本区域)的垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2446544/