如何在iPhone/iPad的UIWebView中调整PDF高度 [英] How to fit PDF height in UIWebView in iPhone/iPad
问题描述
我有一个使用UIWebView来显示单页PDF文件的项目.我希望此内容适合高度(垂直).默认设置为仅适合宽度(水平).有什么办法可以克服这个问题?
I have a project that uses a UIWebView to display a single page PDF file. I would like this content to fit by height (vertically). The default is only to fit width (horizontally). Is there any way to overcome this?
推荐答案
我遇到了同样的问题,找不到使用UIWebView的方法.如果您只想显示一个PDF页面,则可以从中获取代码.苹果的ZoomingPDFViewer示例.
I ran against the same problem and couldn't find a way to do it with UIWebView. If you only want to display a single PDF-page, you can pretty much take the code from Apple's ZoomingPDFViewer Example.
我选了两个类PDFScrollView和TiledPDFView,并且对我的项目进行了一些调整,因此我很容易使用它来显示单个PDF页面.
I took the two classes PDFScrollView and TiledPDFView and with a little adjustment for my project, I was easily able to use it to display a single PDF page.
这篇关于如何在iPhone/iPad的UIWebView中调整PDF高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!