In my storyboard I put the UIScrollView
on my UIViewController
. Inside I put a UIView
with a UIButton
, but when I run the app I cannot scroll the UIView
. What am I doing wrong?
This is how the hierarchy looks:
and the properties of scroll view:
and the view (which has a bigger size than scrollview) :
How can I make it scrollable?
From your image it's look like you are using autolayout. So to make view scrollable you need to set the constraints to scrollview and its sub view.
Constraints for scrollview : Top, Trailing, Bottom, Leading and equal width to superview
Constraints for view(inside scrollview) : Top, Trailing, Bottom, Leading, equal width to superview and height(whatever you want to set).
After giving these constraints your view will be scrolled.