2

in my app I have a view controller with an image view in it. But whenever I go there for some reason I can't zoom in or zoom out. What can be the problem?

code:

-(void)loadView {
  UIImageView *imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"testImage.png"]];
  [self.view addSubview:imgView];
  [self.view bringSubviewToFront:imgView];
}
iOSNewbie
  • 23
  • 2

2 Answers2

1

have you tried to put your uiimageview inside a UIScrollView?

Jayyrus
  • 12,961
  • 41
  • 132
  • 214
0

I've had the same problem a while ago. I fixed it by adding an UIScrollView between self.view and imgView. Here you can find the code I used. Please note that I was setting imageLink variable before pushing that view controller.

Hope it helps

Community
  • 1
  • 1
Novarg
  • 7,390
  • 3
  • 38
  • 74