UIWebView pagination
I have a large html content to render in a UIWebView, I want to display the content in pages just like a book and the user uses buttons to navigate the pages. Is there any way to calculate the height of html content that fits开发者_如何学Go in the webview without scrolling?
If anyone comes around, in iOS7 and more you can just do :
self.webview.paginationBreakingMode = UIWebPaginationBreakingModePage;
self.webview.paginationMode = UIWebPaginationModeLeftToRight;
for (id subview in self.webView.subviews)
{
if ([[subview class] isSubclassOfClass:[UIScrollView class]])
{
((UIScrollView *)subview).pagingEnabled = YES;
break;
}
}
精彩评论