开发者

Add zoom to scrollview

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 *)viewF开发者_如何学GoorZoomingInScrollView:(UIScrollView *) scrollView {return imageView; }

How can this be done?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜