Creating UIView Scrolling Without UIScrollView

Basically, I'm trying to make a regular UIView scrollable (without a UIScrollView). When my application changes orientation from portrait to landscape, content that falls below the lower border becomes inaccessible. When I tried to use UIScrollView, I still could not access the content below the bottom border, and ScrollView did not resize to follow the restrictions that I set for it.

Can someone help me scroll through a UIView?

+5
source share
2 answers

You can make UIView scrollable, but not in the usual way. As @colinrf said for UIScrollView. But, for example, you can make the UIView double the height of the screen, and then subtract and add the Y Rect value according to the movements of the UITouch . For example, if the touch location (delta, if you want) moves negatively from the middle of the screen to the top, also move the Y value negatively. You can do this with UIGuestureSwipe .

+1
source

You cannot scroll through a UIView. This is for UIScrollView. However, if you use storyboards, you can try to add restrictions to the view, so when you rotate the device, the content remains inside the visible area. It looks like you already have some restriction settings, so I would just play with them. Sometimes this may require some tweaking to fix them correctly.

+1
source

All Articles