How to Set Padding Space in EditText field on Android Xml Java

Padding edittext view example

Here is how to set padding in EditText field in Android studio xml Java

Sometimes, you may need set some padding in the EditText field, it is actuality a good thing for your app to look more professional.

You can use this example here to set padding space inside EditText

<EditText
android:textColor="@color/zwhite"
android:includeFontPadding="true"
android:paddingLeft="5dp"
android:background="@drawable/edittext_bg"
android:inputType="textWebEditText"
android:id="@+id/urlbox2"
android:textSize="22sp"
android:imeOptions="actionDone"
android:selectAllOnFocus="true"
android:allowUndo="true"
android:windowSoftInputMode="stateHidden"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:hint="Enter Link | Google Search"
android:layout_gravity="center"
/>

That’s it, let me know if you meet any error.


,

Post navigation

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.