Cocoa touch - problem with UIScrollView

Hey guys. so I have this UIScrollView inside another UIView without occupying the entire area (all this is initialized via the nib file). I added some content to the scroll view, but whenever I scroll it, the content area of ​​the UIScrollView moves out of the scope of the ScrollView above the area of ​​the UIView not intended to display it.

Doesn't he stay inside his frame, even when I scroll through it?

Thanks for helping me.

+5
source share
3 answers

Perhaps the property of clipsToBoundsyour UIScrollView is set to NO. Check the setting in IB, or you can set it in code as follows:

scrollView.clipsToBounds = YES;

, UIScrollView , , , . - , ?

+6

ClipToBounds YES, , :

yourViewController.clipsToBounds = YES;

... fbreto , ...

0

Make sure you have setContentSize installed. And also set the size of the uiviews frame inside the uiscrollview correctly when you add them.

Here is a sample code http://developer.apple.com/library/ios/#samplecode/Scrolling/Introduction/Intro.html

0
source

All Articles