Change UIScrollVIew Content Inset scrollViewDidScroll settings

I use the following code to install contentInsetfor mine tableView.

self.scrollView.contentInset = UIEdgeInsetsMake(109, 0, 44, 0);

But this calls the delegate method UIScrollView scrollViewDidScroll:.

Is this the expected behavior? If so, is there a workaround to avoid this situation?
Thanks in advance.

+5
source share
2 answers

You can try to remove the scroll view delegate before installing content attachments. Then re-fill the delegate.

id scrollDelegate = scrollView.delegate;
scrollView.delegate = nil;
scrollView.contentInset = UIEdgeInsetsMake(109, 0, 44, 0);
scrollView.delegate = scrollDelegate;
+4
source

, , , scrollViewDidScroll. scrollViewDidScroll . . true false, .

0

All Articles