一种避免在scrollViewDidEndDragging中改变contentInset时闪动的解决方案

            [UIView animateWithDuration:0 animations:NULL completion:^(BOOL finished) {
                [UIView animateWithDuration:0.25 animations:^{
                    scrollView.contentOffset = CGPointMake(0.0f, 0.0f);
                    scrollView.contentInset = UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f);
                } completion:NULL];
            }];

关键在于:套两层animation!spa

 

keyword: UIScrollView contentInset contentOffsetcode

相关文章
相关标签/搜索