Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a UIScrollView to an existing view with lots of objects... how to easily make whole view scrollable?

I made an app that has a lot of content on its view (images, buttons, text labels, etc.) and is optimized for the iPhone 5 display. However, the part of the view that is missing when viewed on an iPhone 4 screen is just additional settings, and is perfectly acceptable to be hidden until scrolled to.

So, how do I made my entire view scrollable for iPhone 4 users? I tried just dragging and dropping a UIScrollVIew object over the top of the whole view, but it doesn't add scrolling capability.

I have worked with UIScrollView before, but it was always something I added to the view before anything else, and don't know how to go about adding it to my view now that there are already bunches of objects. Hopefully there is some easy solution that doesn't require manually addig every object as a subView, etc.

Thanks for the suggestions!

like image 622
jake9115 Avatar asked Dec 13 '25 05:12

jake9115


1 Answers

I don't know how your views are created, but the easiest thing would be to change the class of the main view from UIView to UIScrollView.

like image 136
nevan king Avatar answered Dec 16 '25 05:12

nevan king



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!