I have already built a UIViewController
subclass with a bunch of controls in it, and just realized that if I rotate the iPhone, half of the controls become invisible. So, I would like to somehow make the UIViewController's
UIView
scrollable so that when the device (or the Simulator) rotates, the user can scroll the view to see all the controls.
I was hoping to do this all in Interface Builder. I tried to change the class of the view from UIView
to UIScrollView
in the Class Identity editor, but nothing scrolls. The base class of my view controller is a simple UIViewController
<UIScrollViewDelegate>
.
Is there an easy way to make the main view in my view controller scrollable without having to recreate the whole thing in IB?
It would be helpful to understand what your interface is displaying, but I'd suggest one of the following:
For people who are using storyboard, this is quite easy to do
View
of the UIViewControllerUIScrollView
That's it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With