ios - Objective-C: How to disable verticall scrolling in UIScrollView -


i going add uiscrollview uiview programmatically. tried use following code scrollview still not disabled.

-(id)initwithframe:(cgrect)frame { ...   _scrollview = [[uiscrollview alloc] initwithframe:cgrectzero];   [self addsubview:_scrollview]; ... } -(void)layoutsubviews { ...   _scrollview.frame = cgrectmake(0, 0, self.frame.size.width, 40);   [_scrollview setcontentsize:cgsizemake(self.frame.size.width * 2, 40)]; ... } 

i think should work it's not working now. please advise me problem is. thanks

well, try set contentsize this:

[_scrollview setcontentsize:cgsizemake(self.frame.size.width * 2, 0)]; 

let me know result. thanks.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -