This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Android and the fly likes  two different styles in one string ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark " two different styles in one string ?" Watch " two different styles in one string ?" New topic
Author

two different styles in one string ?

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 188
Hi,

How can I define the text in a TextView that contain one string with two different styles ?
For example : “Hello World

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
It's a bit tricky, but possible. Check out the Spannable interface and its implementations. I think you'd use a SpannableStringBuilder to create such a string.


Ping & DNS - my free Android networking tools app
chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 188
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: two different styles in one string ?
 
Similar Threads
Hexadecimal value for new Color()
Select Item Styles
Smart share the color between styles
file converter method
Applying style to a variable