Juan Khawly
Juan Khawly

Reputation: 1

My ScrollView is scrolling even when my contentsize is smaller than its frame

I created this tree in an IB:

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

Answers (1)

Stavash
Stavash

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

Related Questions