添加缩放到滚动视图
当图像位于子视图控制器中时,如何以 Potrate 方向向滚动视图添加缩放功能。在方向更改中,我调用设置函数来更改
if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) ||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight)) {
self.navigationController.navigationBarHidden = YES;
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[self setWantsFullScreenLayout:YES];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
[self setWantsFullScreenLayout:NO];
self.navigationController.navigationBarHidden = NO;
//// Zoom enable ////
}
为加载控制器
for (int i=0; i < [appDelegate.inGallery count];i++) {
ScrollViewPic *controller = [viewControllers objectAtIndex:i];
controller = [[ScrollViewPic alloc] initWithFrame:CGRectMake(0, 0, _scrollView.bounds.size.width, _scrollView.bounds.size.height)];
controller.svController= self;
[viewControllers replaceObjectAtIndex:i withObject:controller];
.....
无法使用 viewForZoomingInScrollView 因为图像位于其他视图控制器中。
- (UIView *)viewForZoomingInScrollView:(UIScrollView *) scrollView {return imageView; }
这怎么能做到呢?
How can i add a zoom function to my scrollview in Potrate orientation, when the images are in an subview controllers. in orientation change i call a setup function to change
if (([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeLeft) ||
([[UIDevice currentDevice] orientation] == UIDeviceOrientationLandscapeRight)) {
self.navigationController.navigationBarHidden = YES;
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[self setWantsFullScreenLayout:YES];
} else {
[[UIApplication sharedApplication] setStatusBarHidden:NO];
[self setWantsFullScreenLayout:NO];
self.navigationController.navigationBarHidden = NO;
//// Zoom enable ////
}
to load controllers
for (int i=0; i < [appDelegate.inGallery count];i++) {
ScrollViewPic *controller = [viewControllers objectAtIndex:i];
controller = [[ScrollViewPic alloc] initWithFrame:CGRectMake(0, 0, _scrollView.bounds.size.width, _scrollView.bounds.size.height)];
controller.svController= self;
[viewControllers replaceObjectAtIndex:i withObject:controller];
.....
Cant use viewForZoomingInScrollView because the images are in an other viewcontroller.
- (UIView *)viewForZoomingInScrollView:(UIScrollView *) scrollView {return imageView; }
How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论