Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

editText lineSpacingExtra issue

I have an editText with layout:

<EditText
        android:id="@+id/edittext"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        android:text="test"
        android:layout_margin="5dp"
        android:gravity="left|center_vertical"
        android:lineSpacingExtra="10dp"
        android:lineSpacingMultiplier="1"
        />

but the text is not centered vertically because of lineSpacingExtra. Here is how it looks:

enter image description here

how to make it so I keep lineSpacingExtra tag but have text centered vertically?

like image 596
Buda Gavril Avatar asked Aug 10 '12 08:08

Buda Gavril


1 Answers

I found a way to simulate this but not an actual solution. You can add padding top but it's not a safe solution.

<EditText
    android:id="@+id/edittext"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:paddingTop="18dp"
    android:gravity="left|center_vertical"
    android:lineSpacingExtra="10dp"
    android:lineSpacingMultiplier="1"
    android:text="test" />
like image 177
cosmincalistru Avatar answered Oct 21 '22 12:10

cosmincalistru