My madness with a UIScrollView [solved]

I have been working on a universal project which works perfectly on a touch/iPhone. I started to inject the iPad-specific code and noticed that my UIScrollView wasn’t updating the current page frame when paired with a UIPageControl. I kept logging the math behind it (simple) which was logging correctly. Using Storyboards and ARC.

After wondering what the hell was going on, I clicked on the UIScrollView in the iPhone Storyboard and took note of it’s size inspector. I think checked out the iPad Storyboard and saw that the UIScrollView there was defaulted to the “Content Hugging Priority”. I don’t know what’s going on there yet, but I figured that that resizing behavior was totally borking my iPad bit.

Go to the File Inspector on the right in Xcode and you’ll see in the Interface Builder Document grouping that Use Autolayout is checked by default. I get it, I know that Apple wants us to migrate to this because it’s better, but if you uncheck that box for your Storyboard you’ll get the old & familiar size inspector. I made the quick adjustments there and now my UIScrollView is behaving properly again.

Burned almost 45 minutes on this dance with my face in the wall.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *

8 × = sixteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>