Reputation: 13347
The project I'm currently working requires that a UIScrollView
to scroll vertically and horizontally, however, it must only bounce vertically. Is this possible? I noticed that there is a verticalBouncing
and horizontalBouncing
property in the declaration, could that be the answer?
Upvotes: 0
Views: 168
Reputation: 10333
You cannot access @package
ivars directly. However, you can register yourself as delegate of UIScrollView
and implemenet this code
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
float maxX = scrollView.contentSize.width - scrollView.frame.size.width;
CGPoint offset = scrollView.contentOffset;
offset.x = MAX(MIN(maxX, offset.x), 0);
scrollView.contentOffset = offset;
}
Upvotes: 3