Note that there are some explanatory texts on larger screens.

plurals
  1. POUIScrollView - Unable to scroll to the bottom
    primarykey
    data
    text
    <p>I have a view which is about three times the size of the UIScrollView. I've configured the scroll view like this:</p> <pre><code>_scrollView.canCancelContentTouches = YES; _scrollView.autoresizesSubviews = NO; _scrollView.translatesAutoresizingMaskIntoConstraints = NO; [_scrollView addSubview:mapView]; _scrollView.contentSize = mapFrame.size; _scrollView.contentInset = UIEdgeInsetsZero; </code></pre> <p>I've also assigned a feasible zoom level inspired by <a href="http://www.raywenderlich.com/10518" rel="nofollow">Matt Galloway's tutorial</a>:</p> <pre><code>-(void) viewDidAppear: (BOOL)animated { CGRect scrollViewFrame = _scrollView.frame; CGFloat scaleWidth = scrollViewFrame.size.width / self.scrollView.contentSize.width; CGFloat scaleHeight = scrollViewFrame.size.height / self.scrollView.contentSize.height; CGFloat minScale = MIN(scaleWidth, scaleHeight); // Calculate the content size for the scroll view _scrollView.maximumZoomScale = 1; _scrollView.minimumZoomScale = minScale; } </code></pre> <p>My problem is that I can't reach the bottom of the scroll view's subview. It always bounces back about 1/6 of the subview's height. Do you have any ideas what I might be doing wrong?</p> <p>An image illustrating the problem: <a href="http://i.imgur.com/HCHhGd9.jpg" rel="nofollow">http://i.imgur.com/HCHhGd9.jpg</a>. You can see that the bottom square is cut off by the scrolling issue.</p> <p><strong>Edit</strong></p> <p>I resolved the issue by creating the UIScrollView programmatically. It was previously defined in the storyboard. I'm still rather curious what I was potentially doing wrong–perhaps the proportions were different? Checking this out now.</p> <p><strong>Edit #2</strong> </p> <p>No, the sizes were the same. This will remain a mystery to me :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload