• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multiple styles inside a TextView

 
gem gaurav
Greenhorn
Posts: 1
Android
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i want to put large text inside textView. The text has multiple section with multiple colours. i have seen Html.fromHtml() function and also know how to use setSpan(). But any of these not work for me. In my case i dont know the id of text View at runtime. As i am inflating different Views at runtime each View has many textViews. It will be better if i can find a way to set styles in strings.

Please some one help me out i have spend so much time here.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and welcome to the Javaranch.

Please read our faq's about KeepItDown & PatienceIsAVirtue.
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Gaurav Mehta android" please see your private messages regarding an important administrative matter.

It would help if you posted some of the code you tried - ItDoesntWorkIsUseless. I have successfully used setSpan() to apply formatting to text items. Post both the layout you used and the code that calls setSpan.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic