I’m using a TextSwitcher, however the setText() method takes in a CharSequence rather than an resID integer. If I use getString(resID) the formatting is stripped out. Is there a way to get formatted text (with bold and italics) to show in a TextSwitcher?
I’m using a TextSwitcher , however the setText() method takes in a CharSequence rather
Share
Learn about
SpannableStringBuilder, this is so useful in producing styled text.Then just create your formatted strings like:
Edit:
TextSwitcheris just a small wrapper toViewSwitcher. Examining the sources ofTextSwitcherreveals:So, just call this instead of
setText: