I don't think it is possible to have the hint of a TextView
be in the middle, only left or right depending on your language localization.
EDIT: With that said, why not try to add preceding/succeeding blank spaces (spacebar characters) in order to sort of hack the alignment of the hint inside your TextView
?
Eg, if you want your text aligned to the left, add the following to your XML
android:gravity="start"
android:hint=" This is my hint"
Otherwise, of you want your text aligned to the right
android:gravity="end"
android:hint="This is my hint "
Note: I added three spaces just to emphasize the empty spaces inside the hint, but you can play around with the right amount for you, ofc.
You can add padding to the start/left to the TextInputEditText
android:paddingStart="30dp"
android:paddingLeft="30dp"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.