Comment afficher "OL" TAG HTML dans Android TextView. J'utilise déjà widget webview et ça marche bien, mais je souhaite utiliser TextView pour afficher le contenu HTML. P>
3 Réponses :
Ajoutez ceci à votre TextView
p>
TextView yourTextView =(TextView)findViewById(R.id.text); yourTextView.setText(Html.fromHtml("<p align=right> <b> "+ "I am humman" + " </b> </p>"));
Vous pouvez afficher la balise HTML "OL" avec le code suivant.
val displayText = Html.fromHtml( "<ol>\n" + "<li>First</li>\n" + "<li>Second</li>\n" + "<li>Third</li>\n" + "<li>Fourth</li>\n" + "<li>Fifth</li>\n" + "</ol>" ) displayTextView.text = txt
Non, parce que la tag n'est pas prise en charge. développeur.android.com/Guide/topics/resources/... < / a>
Recommander ceci: p>
htmlcompat.fromhtml ("mot de passe oublié", htmlcompat.from_html_mode_legacy) p>
Après beaucoup de recherche, j'ai trouvé une balise de soutien. MyANDroidSolutions.com/2017/09/29/Android- html-textview / ... grokkingandroid. com / ... Stackoverflow.com / Questions / 44410675 / ...