开发者

Is contentOffset the right property to determine the scrolling position of the scroll view?

开发者 https://www.devze.com 2022-12-26 06:45 出处:网络
I need to get the current scroll开发者_StackOverflowing position of an UIScrollView. How could I do that?It is the contentOffset property of your UIScrollView that holds the current offset of the cont

I need to get the current scroll开发者_StackOverflowing position of an UIScrollView. How could I do that?


It is the contentOffset property of your UIScrollView that holds the current offset of the content view. Simply add this method to your UIScrollViewDelegate to watch how the value of the contentOffset changes when you scroll:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    NSLog(@"contentOffset: %@", NSStringFromCGPoint(self.contentOffset));
}
0

精彩评论

暂无评论...
验证码 换一张
取 消