是否有 UIWebView 的替代方案来动态显示格式化文本?
开发一个需要获取大量文本、根据用户选择的字体大小等对其进行分页并使用样式显示的应用程序。事实证明,使用 UIWebView
对文档进行分页非常麻烦。我见过核心文本的包装器,显然它负责布局,但我的理解是核心文本无法选择。
希望做一些类似于通过应用程序“eReader”提供的书籍或为书籍“The Adderall Diaries”制作的应用程序。有人知道他们是如何做到这一点的吗?我以为它是 UIWebView。
Working on an app that needs to take a large amount of text, paginate it based on user selected font size, etc., and display it with styles. Getting UIWebView
to paginate a document has proven extremely troublesome. I have seen a wrapper for Core Text that apparently, takes care of layout, but my understanding is that core text cannot be selected.
Looking to do something similar to the books available through the app "eReader", or the app made for the book "The Adderall Diaries". Anyone know how they accomplished this? I had assumed it was UIWebView
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常我会说将 UILabel 与 NSAttributedString 一起使用,但是由于您还需要选择文本,所以事情会变得更加复杂。前往 Apple 开发论坛并查看 iOS 6 中对属性字符串的更改(处于 NDA 之下)。
Normally I'd say using UILabel with NSAttributedString, however since you also need to select text, things get a bit more complicated. Head over to the Apple Dev Forums and check out the changes in iOS 6 to attributed strings (it's under NDA).