从Android TextView中的HTML订购的列表

发布于 2025-02-08 10:29:57 字数 914 浏览 1 评论 0原文

我的意图是将HTML数据加载到文本视图中,以订购(1,2,3,4,..... N)列表 ..但是 UI总是在项目符号中显示比有序列表。我已经搜索并试图遵循一些解决方案,但没有任何可行。您的帮助将是惊人的,并且非常感谢。

我遵循的过程在下面给出。

dataBinding.tvBody.text = HtmlCompat.fromHtml(
      text,
      HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_DIV,
)

此处的值 text

<div><b>Test Data Added Here For EN</b></div><ol><li>15% on discount on video consultation and tele consultation with family medicine doctor, nutritionist, gynecologist, physiotherapist, &amp; dental surgeon.</li><li>15% discount on home sample collections on any pathological test &amp; imaging test.</li><li>15% discount on the 1st visit with family medicine doctor’s fee.</li><li>5% discount on annual health checkups.</li></ol>

My intention is to load HTML data into a textView as an ordered (1,2,3,4,.....n) list.But the UI shows always in bullet points rather than an ordered list. I have searched and tried to follow some solutions but nothing works. Your help would be amazing and much appreciated.

The procedure I followed is given underneath.

dataBinding.tvBody.text = HtmlCompat.fromHtml(
      text,
      HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_DIV,
)

Here the value of text is,

<div><b>Test Data Added Here For EN</b></div><ol><li>15% on discount on video consultation and tele consultation with family medicine doctor, nutritionist, gynecologist, physiotherapist, & dental surgeon.</li><li>15% discount on home sample collections on any pathological test & imaging test.</li><li>15% discount on the 1st visit with family medicine doctor’s fee.</li><li>5% discount on annual health checkups.</li></ol>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文