Reputation: 51
Can not detect click some UIButton on UIScrollview. I described my problem in image description.
CODE :
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
CGFloat scrollViewHeight = 0.0f;
for (UIView* view in _vContain.subviews) {
scrollViewHeight += view.frame.size.height;
}
[_svContain setContentSize:(CGSizeMake(_svContain.frame.size.width, scrollViewHeight + 50))];
}
Upvotes: 0
Views: 604
Reputation: 154
Please set ContentSize
of your UIScrollView
.
Do it like this :
scroll.contentSize = CGSizeMake(ScreenWidth, btn.frame.origin.y+btn.frame.size.height +10);
set your UIScrollview
height like i show you in your image.
Upvotes: 3