且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我如何创建的EditText多行字符串?

更新时间:2023-11-06 16:19:22

您可以使用安卓的minlines =3显示中的EditText多行。 并在的EditText的顶部显示的光标,你可以像使用机器人:顶重力=

You can use the android:minLines="3" for display the multiline in edittext. and for display cursor on the top of the edittext you can use like android:gravity="top."

<EditText
            android:id="@+id/edittext"
            android:layout_width="match_parent"
            android:layout_height="fill_parent"
            android:minLines="3"
            android:maxLines="5"
            android:gravity="top"
            android:inputType="textMultiLine" />