Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何使pdf页面适合vfr阅读器的屏幕大小_Iphone_Objective C_Ipad - Fatal编程技术网

Iphone 如何使pdf页面适合vfr阅读器的屏幕大小

Iphone 如何使pdf页面适合vfr阅读器的屏幕大小,iphone,objective-c,ipad,Iphone,Objective C,Ipad,在你的iPhone应用程序中有没有使用过vfr阅读器。我使用这个vfr阅读器来显示pdf页面。我需要的是,当用户将方向从纵向更改为横向时,我需要使pdf页面适合整个屏幕。我怎样才能做到这一点 这只是找到正确的缩放因子和设置内容偏移量的问题。在ReaderContentView.m中,将以下函数添加到文件顶部 static inline CGFloat ZoomScaleThatFills(CGSize target, CGSize source) { return (target.wid

在你的iPhone应用程序中有没有使用过vfr阅读器。我使用这个vfr阅读器来显示pdf页面。我需要的是,当用户将方向从纵向更改为横向时,我需要使pdf页面适合整个屏幕。我怎样才能做到这一点

这只是找到正确的缩放因子和设置内容偏移量的问题。在ReaderContentView.m中,将以下函数添加到文件顶部

static inline CGFloat ZoomScaleThatFills(CGSize target, CGSize source)
{
    return (target.width / source.width);
}
在同一文件中,在updateMinimumMaximumZoom函数中,按如下方式更改行:

CGFloat zoomScale = ZoomScaleThatFills(targetRect.size, theContentView.bounds.size);
[self updateMinimumMaximumZoom]; // Update the minimum and maximum zoom scales

self.zoomScale = self.minimumZoomScale; // Set zoom to fit page width

// Set Offset to 0 to scroll to top of page         
self.contentOffset = CGPointMake((0.0f - CONTENT_INSET), (0.0f - CONTENT_INSET)); 
最后,在initWithFrameFunction中,几乎在最末端更改行,如下所示:

CGFloat zoomScale = ZoomScaleThatFills(targetRect.size, theContentView.bounds.size);
[self updateMinimumMaximumZoom]; // Update the minimum and maximum zoom scales

self.zoomScale = self.minimumZoomScale; // Set zoom to fit page width

// Set Offset to 0 to scroll to top of page         
self.contentOffset = CGPointMake((0.0f - CONTENT_INSET), (0.0f - CONTENT_INSET)); 

对我来说就是这样,希望对你也一样

完美-我试着在一段时间内完成这项工作-干得好拇指助手有人能详细解释一下目标应该是什么和来源应该是什么吗?我设置目标aas视图框架和源作为读卡器框架,宽度正常,但高度不能正常工作