¡@

Home 

2014/10/15 ¤U¤È 10:13:40

iphone Programming Glossary: scrollview.contentoffset.x

Finding the direction of scrolling in a UIScrollView?

http://stackoverflow.com/questions/2543670/finding-the-direction-of-scrolling-in-a-uiscrollview

void scrollViewDidScroll UIScrollView sender ScrollDirection scrollDirection if self.lastContentOffset scrollView.contentOffset.x scrollDirection ScrollDirectionRight else if self.lastContentOffset scrollView.contentOffset.x scrollDirection ScrollDirectionLeft.. self.lastContentOffset scrollView.contentOffset.x scrollDirection ScrollDirectionRight else if self.lastContentOffset scrollView.contentOffset.x scrollDirection ScrollDirectionLeft self.lastContentOffset scrollView.contentOffset.x do whatever you need to with scrollDirection.. else if self.lastContentOffset scrollView.contentOffset.x scrollDirection ScrollDirectionLeft self.lastContentOffset scrollView.contentOffset.x do whatever you need to with scrollDirection here. I'm using the following enum to define direction. Setting the first value..

UIScrollView Infinite Scrolling

http://stackoverflow.com/questions/3430267/uiscrollview-infinite-scrolling

fast not even very fast it goes mad Heres the code void scrollViewDidScroll UIScrollView scrollView float pageNumber scrollView.contentOffset.x 320 float pageCount scrollView.contentSize.width 320 if pageNumber pageCount 4 Add 10 new pages to end mainScrollView.contentSize..

UIScrollView getting the current page

http://stackoverflow.com/questions/4132993/uiscrollview-getting-the-current-page

improve this question There is no UIScrollView property for the current page. You can calculate it with int page scrollView.contentOffset.x scrollView.frame.size.width If you want to round up or down to the nearest page use CGFloat width scrollView.frame.size.width..

how to handle tiling of images on the fly

http://stackoverflow.com/questions/5985477/how-to-handle-tiling-of-images-on-the-fly

YES And in ScrollViewDelegate method. void scrollViewDidScroll UIScrollView scrollView if isZoomed xOffset scrollView.contentOffset.x yOffset scrollView.contentOffset.y above both are CGFloat type variable declared at class level visibleColumn xOffset chunkWidth..