how to pad cursor in input field in Android

52 Views Asked by At

I have a cursor and hint that insists on being flush to the top left of an input field and I was wondering how I can fix this typically.an

2

There are 2 best solutions below

0
Ashi Agarwal On

If you want to keep it in the center set gravity as the center in XML.

android:gravity="center"
0
MontDeska On

If you want to center it, you can use the property gravity as Ashi Agarwal said. But you need to center it vertically:

android:gravity="center_vertical"