I try to use 'paginationMode' to make my html-content pagination for iOS 7 latter.
//set webview to transparent
webView.backgroundColor = [UIColor clearColor];
webView.opaque = NO;
// set multi-columns
webView.paginationBreakingMode = UIWebPaginationBreakingModePage;
webView.paginationMode = UIWebPaginationModeLeftToRight;
webView.pageLength = webView.bounds.size.width;
// set html to transparent background
NSString *transparent = @"addCSSRule('html', 'background-color: transparent')";
[webView stringByEvaluatingJavaScriptFromString:transparent];
but in the end the web view always shows white background, how can I make it transparent?
In case of paginationmode, it's not really working directly from objective c code. However, I got my job done by injecting CSS for 'body' tag:
Note : its for UIWebPaginationModeLeftToRight..
Maybe try to set the background of the scrollView to clear ?
EDIT Ok so it seems that after setting
The background become white behind :/
Your probably want to provide content background. But the technique of setting webview transparent and providing background color to view behind this may not work well when we use pagination left to right.
I solved this issue by providing content background through CSS and cater the issue of blank area at the end of html content with the help of this post
And call this method when webview finish loading content.