1

I'm building an iPad app, and this is the first time I'm using Interface Builder, learning as I go...

I'm starting off with the default SplitView template and for the main view I need a scroll view that will allow me to zoom in the image view within. I have successfully done this programmatically and it works great, but the amount of code needed to keep everything in sync, specially when rotating the device, is just too much.

In Interface Builder I can specify the margins I need for the UIImageView inside the UIScrollView and that will stay that way even if I rotate the device, this is why I want to do it in Interface Builder. The question is "how" do I do this?

I placed the UIScrollView in my main view, and then the UIImageView inside of it. I set a minimum and maximum zoom level in my UIScrollView (in IB), but when I run the app, the image (actually the scrollview) is not zooming in at all. Can this be done in IB?

All the tutorials and YouTube videos I watched say to do the UIImageView portion in code rather than in IB.

Any ideas?

pec1985
  • 151
  • 1
  • 8
  • If you set the ImageView inside the ScrollView to have a flexible width and height (the internal double-ended arrows in IB on the sizing tab), and enable Autoresize Subviews on the ScrollView, does that make it scale with your ScrollView? –  Sep 16 '11 at 06:10
  • Also, see [this](http://stackoverflow.com/questions/3657451/how-to-enable-zoom-in-uiscrollview) question for a solution to enable zooming in `UIScrollView` (not the accepted answer, the other one). –  Sep 16 '11 at 06:16
  • Thanks!! I needed to delegate it – pec1985 Sep 16 '11 at 06:26
  • Added my comment as an answer, then :) –  Sep 16 '11 at 06:28

0 Answers0