Basically, what I'm trying to do is make the normal UIView scrollable (no UIScrollView). When my app changes orientation from portrait to landscape, the content that falls below the bottom boundary becomes inaccessible. When I tried to use UIScrollView, I still couldn't access the content below the bottom boundary and the ScrollView didn't resize to follow the constraints I set for it.
Can someone help me make a UIView scrollable?
You can make a UIView scrollable but not in a conventional way. As @colinrf said, that's what a UIScrollView is for. But, for example, you can make a UIView twice the height of the screen, then subtract and add the Y
value of the Rect
in accordance with the UITouch
movements. For instance, if the touch location (delta if you want) is moving negative from middle of the screen to the top, move the Y
value negatively as well. You can do it by UIGuestureSwipe
too.
You cannot make a UIView scrollable. That's what UIScrollView is for. However if you are using storyboards you can try to add constraints to the view so when you rotate the device the content remains inside the viewable area. Sounds like you already have some constraints setup so I would just play around with them. Sometimes it can take some tweaking to get them right.
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