I have tried android:singleLine, maxLines, lineSpacing attributes but my EditText always displays a part of next line. How can I force it to display a single line at a time?
<EditText
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/formulaView"
android:textColor="#000000"
android:textCursorDrawable="@drawable/visible_cursor"
android:background="#ffffff"
android:layout_marginTop="1dp"
android:textSize="18sp"
android:maxHeight="30dp"
android:gravity="center_vertical"
android:layout_marginBottom="1dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:scrollbars="vertical"
android:imeOptions="actionNext"
android:completionThreshold="1"
android:inputType="textMultiLine|textNoSuggestions"/>
Don't Use
android:inputType="textMultiLine|textNoSuggestions"
Instead use:
android:inputType="textNoSuggestions"
Code:
<EditText
android:layout_width="match_parent"
android:layout_height="30dp"
android:id="@+id/formulaView"
android:textColor="#000000"
android:background="#ffffff"
android:layout_marginTop="1dp"
android:textSize="18sp"
android:text="=SUM(android,Hello,How,Are,You) GoodMorining"
android:maxHeight="30dp"
android:gravity="center_vertical"
android:layout_marginBottom="1dp"
android:paddingStart="10dp"
android:paddingEnd="10dp"
android:scrollbars="vertical"
android:imeOptions="actionNext"
android:completionThreshold="1"
android:singleLine="true"
android:inputType="textNoSuggestions"/>
Hope this will help.
Have a great day ahead.
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.