开发者

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;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜