• <small id='zQTYs'></small><noframes id='zQTYs'>

      <i id='zQTYs'><tr id='zQTYs'><dt id='zQTYs'><q id='zQTYs'><span id='zQTYs'><b id='zQTYs'><form id='zQTYs'><ins id='zQTYs'></ins><ul id='zQTYs'></ul><sub id='zQTYs'></sub></form><legend id='zQTYs'></legend><bdo id='zQTYs'><pre id='zQTYs'><center id='zQTYs'></center></pre></bdo></b><th id='zQTYs'></th></span></q></dt></tr></i><div id='zQTYs'><tfoot id='zQTYs'></tfoot><dl id='zQTYs'><fieldset id='zQTYs'></fieldset></dl></div>

      1. <legend id='zQTYs'><style id='zQTYs'><dir id='zQTYs'><q id='zQTYs'></q></dir></style></legend>
          <bdo id='zQTYs'></bdo><ul id='zQTYs'></ul>

        <tfoot id='zQTYs'></tfoot>
      2. 水平滚动的 PDF 视图

        时间:2023-10-22
        <tfoot id='YumB1'></tfoot>
          <i id='YumB1'><tr id='YumB1'><dt id='YumB1'><q id='YumB1'><span id='YumB1'><b id='YumB1'><form id='YumB1'><ins id='YumB1'></ins><ul id='YumB1'></ul><sub id='YumB1'></sub></form><legend id='YumB1'></legend><bdo id='YumB1'><pre id='YumB1'><center id='YumB1'></center></pre></bdo></b><th id='YumB1'></th></span></q></dt></tr></i><div id='YumB1'><tfoot id='YumB1'></tfoot><dl id='YumB1'><fieldset id='YumB1'></fieldset></dl></div>

          1. <small id='YumB1'></small><noframes id='YumB1'>

              <tbody id='YumB1'></tbody>
            <legend id='YumB1'><style id='YumB1'><dir id='YumB1'><q id='YumB1'></q></dir></style></legend>
              • <bdo id='YumB1'></bdo><ul id='YumB1'></ul>

                  本文介绍了水平滚动的 PDF 视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想获得一些关于如何实现水平滚动的 PDF 视图的提示.

                  I'd like to get some tip about how implement a PDF View that scrolls horizontally.

                  我知道如何使用 UIWebView 实现 PDF 阅读器,但只是垂直滚动.

                  I know how implement a PDF reader using UIWebView, but just with vertically scroll.

                  推荐答案

                  我已经做到了.代码对于付费客户是私有的,所以我不能直接分享,但基本思路是这样写:

                  I've done this. The code was private for a paying customer, so I can't share it directly, but the basic idea is to write:

                  • 一个 UIView 子类,它使用 CGPDFPageRef 以及 CGPDFDocument*CGContextDrawPDFPage 系列职能.此视图从 layerClass 类方法返回 [CATiledLayer class] 并适当地设置图层的 levelsOfDetail 和 tileSize 属性有很大帮助.我的也实现了 sizeThatFits 来返回页面大小加上一个小间距,并在 pdf 页面的边缘呈现一个微妙的阴影.

                  • One UIView subclass that renders a single page of a PDF, using a CGPDFPageRef and the CGPDFDocument* and CGContextDrawPDFPage families of functions. It helps a great deal for this view to return [CATiledLayer class] from the layerClass class method, and to set the layer's levelsOfDetail and tileSize properties appropriately. Mine also implements sizeThatFits to return the page size plus a small gutter, and renders a subtle dropshadow around the edge of the pdf page.

                  请记住,UIKit 绘图与 CG 绘图是颠倒的;CGContextTranslateCTM(ctx, 0.0, layer.bounds.size.height);CGContextScaleCTM(ctx, 1.0, -1.0); 绘制前.

                  Remember that UIKit drawing is upside-down from CG drawing; so do a CGContextTranslateCTM(ctx, 0.0, layer.bounds.size.height); CGContextScaleCTM(ctx, 1.0, -1.0); before painting.

                  一个 UIView 子类包含和布局(并被委托)处于分页模式的 UIScrollView(主水平寻呼机),以及每个页面的单独 UIScrollView,每个页面都包含上述视图之一(用于放大单独的页面.)嵌套滚动视图是Apple明确认可的做这种事情的方式.这个视图需要按照你想要的方式布置页面;大概在一个长的水平条中,每个都缩放到合适的大小.

                  One UIView subclass containing and laying out (and being delegate for) a UIScrollView in paging mode (the main horizontal pager), and an individual UIScrollView for each page, each containing one of the above views (for zooming into individual pages.) Nested scroll views is Apple's explicitly endorsed way of doing this sort of thing. This view will need to lay out the pages how you want them; presumably in one long horizontal strip, each zoomed to a fitting size.

                  如果不需要页面缩放,可以跳过嵌套的滚动视图,直接在水平滚动条中布局页面视图.

                  If you don't need page zooming, you can skip the nested scroll views and lay out the page views directly in the horizontal scroller.

                  TL;DR: 不幸的是,这并不像把它扔进 UIWebView 那样简单;但这是可行的,而且直接的方法确实有效.

                  TL;DR: Unfortunately it's not as simple as tossing it in a UIWebView; but it is doable, and the straightforward approach does work.

                  这篇关于水平滚动的 PDF 视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Webview 自动调整大小为 iphone 中的纵向和横向视图 下一篇:将随机大小的图像放入 UIWebview (IOS)

                  相关文章

                    <small id='2tKPm'></small><noframes id='2tKPm'>

                    1. <i id='2tKPm'><tr id='2tKPm'><dt id='2tKPm'><q id='2tKPm'><span id='2tKPm'><b id='2tKPm'><form id='2tKPm'><ins id='2tKPm'></ins><ul id='2tKPm'></ul><sub id='2tKPm'></sub></form><legend id='2tKPm'></legend><bdo id='2tKPm'><pre id='2tKPm'><center id='2tKPm'></center></pre></bdo></b><th id='2tKPm'></th></span></q></dt></tr></i><div id='2tKPm'><tfoot id='2tKPm'></tfoot><dl id='2tKPm'><fieldset id='2tKPm'></fieldset></dl></div>
                        <bdo id='2tKPm'></bdo><ul id='2tKPm'></ul>
                    2. <tfoot id='2tKPm'></tfoot>
                    3. <legend id='2tKPm'><style id='2tKPm'><dir id='2tKPm'><q id='2tKPm'></q></dir></style></legend>