更改字体时基于页面的加载epub [英] page based load epub when changing font
问题描述
我正在做电子书阅读器应用程序,就像iBooks一样。我已成功读取.epub文件。但我的问题是: -
I am doing ebook reader app like as iBooks. I have succesfully read a .epub file. But my problem is:-
我必须添加字体大小增加和减少以及字体更改功能。当我增加和减少字体大小时,我必须调整页面。如何在页面中拆分HTML字符串? 。
I have to add Font size increase and decrease and font changing functionality. I have to adjust pages When i increase and decrease font size . How can I split HTML string in pages ? .
您可以在两张图片中看到。更改字体大小后,html字符串将被分离,格式化将被折叠。
You can see in both images . After changing font size the html string gets separated and the formatting is getting collapsed.
提前致谢
< img src =https://i.stack.imgur.com/EfHMj.pngalt =在此处输入图像说明>
推荐答案
最后我得到了回答。这很简单。在ios 7中,您不需要为分页或任何逻辑编写javascript。
Finally I got answer .It is very simple . In ios 7 you don't need to write javascript for pagination or any logic .
只需设置UIWebview属性即可。这是我的代码。
Just set UIWebview Property . Here is my code.
self.webView.paginationMode = UIWebPaginationModeLeftToRight;
self.webView.paginationBreakingMode = UIWebPaginationBreakingModePage;
self.webView.scrollView.delegate = self;
self.webView.scrollView.pagingEnabled = YES;
self.webView.scrollView.alwaysBounceHorizontal = YES;
self.webView.scrollView.alwaysBounceVertical = NO;
self.webView.scrollView.bounces = YES;
以下是示例代码a: https://github.com/kalpesh22m/Epub-Reader-With-Pegination
这篇关于更改字体时基于页面的加载epub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!