开发者

inside API scrollViewDidScroll , shows sender correct but sender.contentSize is showing null while calculating page number

开发者 https://www.devze.com 2023-04-01 06:38 出处:网络
I want to find page number in scroll view consisting of uiimage view. Inside the m开发者_StackOverflow中文版ethod, - (void)scrollViewDidScroll:(UIScrollView *)sender

I want to find page number in scroll view consisting of uiimage view.

Inside the m开发者_StackOverflow中文版ethod, - (void)scrollViewDidScroll:(UIScrollView *)sender

on logging it shows sender value properly i.e everything about scroller correct,

but for calculation when i use sender.contentOffSet.x then it shows null

Thanks.


Try using following method of UIScrollViewProtocol

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

Default value if contentSize is zero....see following details from apple documentation.

contentOffset The point at which the origin of the content view is offset from the origin of the scroll view.
Discussion The default value is CGPointZero.
contentSize The size of the content view.
Discussion The unit of size is points. The default size is CGSizeZero. Related Sample Code QuartzDemo
0

精彩评论

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