Align spinner values to right instead of left

人盡茶涼 提交于 2019-12-03 10:43:04
Lalit Poptani

You have to use a custom view here to give alignment to the Spinner values. Create a CustomView like this answer has created and add android:gravity to the TextView as right.

UPDATE:

Set the CustomView to your adapter using

adapter.setDropDownViewResource(android.R.layout.your_custom_created_view);
Eddy Charry

You can use TextAlignment on properties and select TextEnd, or android:textAlignment="textEnd" on XML simple

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!