Error: User interaction disabled in lower parts of UIScrollView

1.2k views Asked by At

I've got a document viewer that has one UIView (page) as a subview of a 'scrolledView' (UIView) of a UIScrollView. The page has more subviews, UIButtons and UITextFields for example.

The user can manually pan and zoom in the scroll view, but for some features, I'm doing a programmatic scrolling/panning to bring the text fields or buttons into view.

In some cases I need to programmatically adjust the contentSize for the scroll view and the frame of the scrolled view (to make sure text fields at the bottom of the page can be moved above the keyboard).

Also (I think) I'm correctly scaling the coordinates for contentSize and the frame of the scrolled view by the zoomScale of the scroll view.

Usually everything works as it should.

This is the problem:

In some rare occasions, after I've triggered the zooming out by clicking 'Next' on the keyboard, the buttons and text fields in the lower part of the page don't react to my touch any more. (It's usually around the lowest 10% or so.) Those above do like they should.

Can anybody give me any hints what to look for?

I have seen this on iOS 7 and iOS 8, older versions I don't know.

3

There are 3 answers

0
flo von der uni On BEST ANSWER

It seems some problems where caused by readjusting the contentSize and frame of the scrolled view inside - (void)scrollViewDidZoom:(UIScrollView *)scrollView Then other parts modified the same properties, for example in completion blocks of animations and it is possible that the values ended up wrong.

(I was using a trick to keep the content centered when the user had zoomed out. Now I'm instead getting the same effect by using the contentInsetproperty)

0
Ruslan On

If your collectionView is out scrollView contentSize you should drag and drop the constraint from interface builder and when you change the position of collectionView you should change the constraint constant too. This worked for me

0
Jay On

I know its really late but it might help someone who can have same issue. I just came up with same issue and this was the only question which was matching with my problem. Eventually i solved it.

It seems like user interaction is only enabled for specified height of the frame. So, I solved it by increasing the hight of the frame which is embedded under the scrollview.