4
I want to add a formatted text (can be in html) on my Textview screen but I’m not getting it.
I have string in values:
<string name="lbl_explicacao">
<![CDATA[
<b> TESTE </b>
TESTE
TETES
]]>
</string>
There’s such a thing Html.fromHtml(String, flags)
, but I don’t know how to use
The text I want to do is kind of large, with 283 words, but I would like to format the title and such..
I tried to use in string
<string name="lbl_explicacao"> <![CDATA[
<b>What is Lorem Ipsum?</b>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.]]>
</string>
But when I try to compile it shows
<string name="lbl_explicacao">
<b> bla bla bla </b>
....
</string>
it really needs to be in a Textview, because if you go through a webview you have more possibilities for formatting?
– Armando Marques Sobrinho
Because I think it would appear as a web page (I think), if it appears as a Textview, I can try
– adventistaam
Voce can configure to look like you want, can by a white background, image background, at last, is a mini browser that you can use jvascripts, can use css and much more, see a my application using webview: https://play.google.com/store/apps/details?id=com.armando.raonimotores.ossonhosdeaaz. on it, the top is java, the bottom is a webview
– Armando Marques Sobrinho
I’m searching how to use it. Because I actually already have a predefined text in the strings.xml file. I would like it to be displayed
– adventistaam
i tried to use in string <string name="lbl_explanation"> <![CDATA[]]>
– adventistaam
You should not change the question this way, now my answer has become meaningless. I will reverse the edition.
– ramaral
Blz. It’s just that I’m still learning to hit you with this technology.. Sorry
– adventistaam