简体   繁体   中英

android: how can i create a TextView combining icom?

is there an easy way to create a text view with an icon inside the text? like in this number of rates example:

(** 3,45642)

(I have less then reputeshion 10 so I cant insert the image I wanted

** means an icon of a small man)

or is it part of RatingBar that i couldn't find?

I don't want to use android:drawableLeft="@drawable/my_icon" as i feel like the parenthesis are critical.

Many thanks for any help!

Check out SpannableStringBuilder class.

Usage examples are posted here:

http://www.programcreek.com/java-api-examples/index.php?api=android.text.SpannableStringBuilder

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM