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.


Related Posts

Here is How to Get Host Domain from URL in Android Java

Sometimes, we might need extract domain name such as www.google.com from the www.google.com/search=searchQuery. In android java, the code below can do it. It will output only the…

Android SoftKeyBoard Enter Key Handling

How to Handle Android Keyboard’s Enter Key to Support your Own Function By default, android soft keyboard’s enter key doesn’t support your own function even if you…

Test Intent and URL Schemes of Android Webview

URL Schemes Tester This page contains different URL Schemes that can be used to test various URL Schemes, it was created to test android webview, but other…

Realme XT Specifications, Launch Date, Price and Details

Realme xt details, launch date and reviews The Realme XT is an android smartphone with a massive 64 Mega pixels camera and qualcomm snapdragon 712 processor. Brand…

How to Copy a Webview Link in Android Java

Here is how to Copy current web address url in Android Java With the simple java code below, you can copy a link of current loaded website…

How to get Android App Version Programmatically in Java Android Studio

Here is how to get android app current version code programmatically in java android Sometimes, you will need get the current version number of your android app…

Leave a Reply

Your email address will not be published.