0

I have HTML text as that

<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>I am normal</p>


<p><b>This text is bold</b></p>
<p><i>This text is italic</i></p>
<p>This is<sub> subscript</sub> and <sup>superscript</sup></p>

and it should appear like that


This is a heading

This is a paragraph.

I am normal

This text is bold

This text is italic

This is subscript and superscript


How can I split the whole text into screens Based on screen width and height and with the HTML style?

I tried this answer How to break styled text into pages in Android? but the HTML style not saved

Is there any library or code can do this?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
ahmed saber
  • 350
  • 1
  • 3
  • 15
  • [Paginating text in Android](https://stackoverflow.com/a/32096884/3290339). However keep in mind that only a limited set of `html` tags is supported by Android. – Onik May 24 '18 at 15:57

1 Answers1

0

Full HTML can be rendered just in WebViews, to have screen-related text dimensions you can use a custom styled TextView nested in a layout like RelativeLayout, referencing views width and height in dimens.xml (so you can adopt different paddings and dimensions for small and large devices)

ci0ccarellia
  • 795
  • 9
  • 26