I have a UIScrollView
. The scrollview.contentSize
is set to the height of all subviews in the UIScrollView
. When the height of the c
In swift:
scrollView.alwaysBounceVertical = true
scrollView.alwaysBounceHorizontal = true
There are two properties on UIScrollView
that sound like what you want:
@property(nonatomic) BOOL alwaysBounceVertical; // default NO. if YES and bounces is YES, even if content is smaller than bounds, allow drag vertically
@property(nonatomic) BOOL alwaysBounceHorizontal; // default NO. if YES and bounces is YES, even if content is smaller than bounds, allow drag horizontally
Simply set one or both of them to YES
and you will get the bounce effect.
This can also be set in IB by checking the "Bounce Horizontally" and/or "Bounce Vertically" box(s):