简体   繁体   中英

Android Studio: Enable EditText direct multiline input

When i build my application in android studio and test it on my phone, the edit text doesn't behave like a text editor and creates a popup input field above the keyboard and waits for you to press done. What I want to achieve is to behave like a text editor and get direct input from the keyboard without pressing done every time you want to add something.

I have tried everything in terms of xml attributes. I even searched how other text editor apps achieve the direct input, but with no avail, the popup field that gets the input and waits for you to press done didn't disappear. Here is my xml code for the edit text:

<EditText
                android:id="@+id/editText"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:background="@drawable/code_edit_text"
                android:scrollbars="vertical"
                android:inputType="textMultiLine"
                android:overScrollMode="always"
                android:scrollbarStyle="insideInset"
                android:lines="16"
                android:gravity="top|left"
                android:maxLines="10000"
                android:singleLine="false"/>

I think its better to try after removing

android:background="@drawable/code_edit_text"
android:scrollbars="vertical"
android:overScrollMode="always"
android:scrollbarStyle="insideInset"

these lines

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM