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

相關文章
相關標籤/搜索