Reputation: 1
I created this tree in an IB
:
UIViewController
UIView
UIScrollView
(x=50 y=50 width=468 height=270) (background a visible color to differentiate)In my controller I explicit do theScrollView.contentSize = CGSizeMake(X,X)
.
When I run the program I still have vertical scrolls even when my contentsize height is smaller than the frame height. Using height values greater than 253 (254 258 ..) but still smaller than 270 make the scrolls appear. Using < 253 the completely disappear.
The horizontal axis has a weird behavior also. The only way to make the horizontal scrolls appear is by setting the content > 471. It means that with 469 and 470 scrolls are still hidden.
Why is this happening?
Upvotes: 0
Views: 911
Reputation: 14304
Check to see that autolayout is disabled in your storyboard. This is to make sure that the content size isn't being reset after the line of code you mentioned.
Upvotes: 1