How to Align ListView Text to Right in Android?

后端 未结 6 1491
旧巷少年郎
旧巷少年郎 2021-01-18 15:24

I have a list view in an Android application used to display an ArrayList containing Strings and I can\'t find any properties of the ListView that would allow me to align th

6条回答
  •  花落未央
    2021-01-18 15:54

    The answer depends on how exactly do you build the list. If you use the the standard ArrayAdapter then you could use the constructor:

    ArrayAdapter(Context, R.layout.aligned_right, values);
    

    where R.layout.aligned_right is a xml layout like this:

    
    

提交回复
热议问题