开发者

Add bullets to Android's listview

开发者 https://www.devze.com 2023-02-19 05:20 出处:网络
What is the best way to add bullet-like images before text? I can set background, but it wants to stretch it and I can\'t define if I want it to float left or right.

What is the best way to add bullet-like images before text? I can set background, but it wants to stretch it and I can't define if I want it to float left or right. I don't want to add开发者_开发问答 different images, just same style bullets in front of every new string.


If you need images, use the android:drawableLeft XML attribute (or drawableRight, for RTL languages). From code, you can use TextView's setCompoundDrawablesWithIntrinsicBounds.


Consider pre-pending the unicode middle dot character to your string.


I just made a custom listview, couldn't find any other way.

0

精彩评论

暂无评论...
验证码 换一张
取 消