Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EditText lineSpacingExtra strange behavior

I have an EditText with lineSpacingExtra set to 8dp. When I open a page with this EditText and preset text, the line spacing works well. But when at the same page I click on the end of the EditText and start typing, the line spacing seems to be ignored.

Is this a bug or am I missing something?

enter image description here

Added code snippet. There's nothing special about it, I think.

<EditText
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/transparent"
        android:padding="8dip"
        android:scrollbars="vertical"
        android:fadingEdge="vertical"
        android:gravity="top"
        android:lineSpacingExtra="8dip"
        android:lineSpacingMultiplier="2"
        android:textSize="18sp"
        android:capitalize="sentences"
        android:inputType="textCapSentences|textMultiLine"
        />

update: Looks like the bug came with the Android 5 Lollipop

like image 778
khusrav Avatar asked Dec 11 '14 11:12

khusrav


1 Answers

this is a bug, that has been posted: https://issuetracker.google.com/issues/37009353 , I find a fix method:this bug occur only when you inputing in the last line, so you can aways append a blank line on the last.

like image 190
taotao Avatar answered Oct 09 '22 13:10

taotao