UIWebView paging / line disabled
I am trying to create a page, so disable scrolling, then the second page is the same web page that scrolls down the page height.
The problem is that there is often a line of text at the bottom of the first page, the second page has the bottom half of the line.
Is there a way to ensure that the entire line ends up in one of the pages? Like Stanza, etc.
thanks
a source to share
You need to paginate the pages into blocks that match the height of the UIWebView. If you can't do it manually, or you want to support different devices and orientations, you'll need to do it in Javascript.
I don't know of any quick way to measure and split text using display size in Javascript. This article might help, but what you need is a way to find out how much text fills a given space, not how much space a given text fills. The trimToPx method here only works for one line and will be slow for large text.
http://blog.mastykarz.nl/measuring-the-length-of-a-string-in-pixels-using-javascript/
There is text for measurement here.
iPhone OS doesn't provide high-level routines for breaking text by dimension, especially styled text, although I haven't tested the 4.0 SDK. You can use CoreGraphics rendering to measure text, but this is quite complicated and doesn't support html.
a source to share