一种避免在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!

 

keyword: UIScrollView contentInset contentOffset

 

posted @ 2015-08-03 20:29  ashamp  阅读(596)  评论(0编辑  收藏  举报