English 中文(简体)
与UIPageViView主计长的手势有问题
原标题:issue with UIPageViewController gesture

透过UIPageViewC主计长(UIPageView Conctor), 我使用Erica Sudan的辅导课程展示一个PDF, 但有两个问题:

1- I can not swipe the book from every corner or every position (the right or left side of the view) I am using apple WWDC 2011 code to swipe from everywhere but does not work :

- (void)viewDidAppear:(BOOL)animated {

    [[[self parentViewController] view] setGestureRecognizers:[self.view gestureRecognizers]];

}

- (void)viewWillDisappear:(BOOL)animated {

    for (UIGestureRecognizer *gesture in [self gestureRecognizers] ) {

        [[[self parentViewController] view] setGestureRecognizers:[self.view gestureRecognizers]];
    }
}

- 需要一点时间来识别擦拭, 我的意思是页面卷曲不是实时的滑动。 我左滑了下来, 用手指移动页面需要时间

谢谢 谢谢

最佳回答

我不知道在您的代码中 < code> self 指的是什么。 需要做的是, 与 < code> UIPageViewcurrent 相关的手势识别器被指派到持有 < code> UIPageView 视图的视图中。 在我的一个项目中, 我使用此代码 :

self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;

self UIViewcurrent 的子类中, 有 UIPageViewcurrent 属性。 UIPageVerence 的视图被添加为 self的子视图。

要回答您的第二个问题, 在 iOS 中绘制 PDF 的速度缓慢。 < code> UIPageView Conserence 装载并绘制 PDF 的下一页( 或前一页) 之后, 才能开始动画卷卷转。 如果您正在显示扩展, 它可能必须再绘制两页。 请用简单的 UIIMageView 对象来尝试您的代码, 而不是用 PDF 视图来查看您的页面控制器代码是否正常工作。 此更改会给您带来高性能效果。 然后您就会知道您需要加快您的 PDF 绘图 。

要加快 PDF 绘图速度, 您可以做的一件事就是在需要预览图像之前, 以同步的速度在需要预览图像之前绘制这些图像。 然后在页面视图控制器中使用这些图像作为您内容视图的初步绘图。 一旦动画稳定下来, 然后从 PDF 重新绘制视图 。 pageView control: didfinishAnimation: previous View Connators: translatefulleted: 方法应该有用 。

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签