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
Post a Comment