Malwinder Singh
Malwinder Singh

Reputation: 7040

paddingBottom not working in Lollipop (API 21) devices

I am trying to add space between line of EditText and text. When I add:

android:paddingBottom="20dp"

It is not working for Android Lollipop (API 21) devices. It is working fine on Android Pie (API 28).

layout:

<android.support.v7.widget.AppCompatEditText
        android:id="@+id/loginUsernameEditText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:drawableLeft="@drawable/username_icon"
        android:drawablePadding="18dp"
        android:lastBaselineToBottomHeight="32dp"
        android:padding="10dp"
        android:paddingBottom="20dp"
        android:textColor="@color/white"/>

Screenshot:

enter image description here

Upvotes: 0

Views: 300

Answers (2)

Akshay Dobariya
Akshay Dobariya

Reputation: 54

Remove this and it will work :)

android:padding="10dp"

Upvotes: 3

Disha Gajera
Disha Gajera

Reputation: 218

Please put below code for space between line of EditText and text. It works for me.

<androidx.appcompat.widget.AppCompatEditText
        android:id="@+id/edtFName"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:drawablePadding="18dp"
        android:gravity="center_vertical"
        android:hint="@string/hint_username"
        android:imeOptions="actionNext"
        android:inputType="text"
        android:maxLines="1"
        android:paddingBottom="30dp"
        android:singleLine="true"
        android:textCursorDrawable="@null"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textHeadSignup" />

Upvotes: 0

Related Questions