uiscrollviewdelegate

In iOS 4.0, why does UIScrollView zoomToRect:animated: not trigger the scrollViewDidScroll or scrollViewDidZoom delegates while animating?

[亡魂溺海] 提交于 2019-11-28 19:12:11
I need to closely monitor the scale of the scroll view so that I can update the content view's elements (a subview managing multiple CALayers ) according to the scroll view's animated zoom. On iOS 3.1, everything works as expected, I use zoomToRect:animated: and the scrollViewDidScroll: message of the UIScrollViewDelegate gets called repeatedly while the animation takes place , letting me update the subview elements according to actual zoom. The same code on iOS 4.0 does not exibit the same behavior. When I call zoomToRect:animated: , the delegates ( scrollViewDidScroll: and scrollViewDidZoom

Want UITableView to “snap to cell”

喜欢而已 提交于 2019-11-28 17:41:46
问题 I am displaying fairly large images in a UITableView . As the user scrolls, I'd like to the table view to always snap the center-most photo in the middle. That is, when the table is in a resting state, it will always have a UITableViewCell snapped to the center. How does one do this? 回答1: You can use the UIScrollViewDelegate methods on UITableView to do this: - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { // if decelerating, let

Custom UIScrollView paging with scrollViewWillEndDragging

岁酱吖の 提交于 2019-11-28 16:21:04
问题 I'm trying to use the new scrollViewWillEndDragging:withVelocity:targetContentOffset: UIScrollView delegate call in iOS 5 but i can't seem to get it to actually respond to me correctly. I'm changing the targetContentOffset->x value but it never ends up being used. I know the code is being ran because it'll hit breakpoints in that function. I've even tried setting the offset value to a hard coded number so i'd know where it would end up but it never works. Has anyone been able to use this

Detecting UIScrollView page change

六眼飞鱼酱① 提交于 2019-11-28 04:15:56
Is there a way to detect or get a notification when user changes the page in a paging-enabled UIScrollView? Implement the delegate of UIScrollView. This method is what you are looking for. - (void)scrollViewDidScroll:(UIScrollView *)scrollView Use this to detect which page is currently being shown and perform some action on page change: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { static NSInteger previousPage = 0; CGFloat pageWidth = scrollView.frame.size.width; float fractionalPage = scrollView.contentOffset.x / pageWidth; NSInteger page = lround(fractionalPage); if (previousPage

UIScrollView, reaching the bottom of the scroll view

£可爱£侵袭症+ 提交于 2019-11-28 03:34:23
I know the Apple documentation has the following delegate method: - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; // called when scroll view grinds to a halt However, it doesn't necessarily mean you are at the bottom. Cause if you use your finger, scroll a bit, then it decelerates, but you are not actually at the bottom of your scroll view, then it still gets called. I basically want an arrow to show that there is more data in my scroll view, and then disappear when you are at the bottom (like when it bounces). Thanks. I think what you might be able to do is to check that your

Detecting the bottom “bounce” of UITableView

瘦欲@ 提交于 2019-11-28 01:00:45
问题 I have a table view that performs an animation when the user scrolls down on a UITableView (push thumb up) and a different animation when the user scrolls up (Push thumb down) on a UITableView. The problem is when the user reaches the bottom of a UITableView and it bounces, the table registers an upward and then downward movement, thus performing the animation when it should not. This same exact behavior happens when scrolling to the top; however, I am able to detect it like so: - (void

Setting contentOffset programmatically triggers scrollViewDidScroll

穿精又带淫゛_ 提交于 2019-11-27 17:17:16
I've got a a few UIScrollView on a page. You can scroll them independently or lock them together and scroll them as one. The problem occurs when they are locked. I use UIScrollViewDelegate and scrollViewDidScroll: to track movement. I query the contentOffset of the UIScrollView which changed and then reflect change to other scroll views by setting their contentOffset property to match. Great.... except I noticed a lot of extra calls. Programmatically changing the contentOffset of my scroll views triggers the delegate method scrollViewDidScroll: to be called. I've tried using setContentOffset

UIScroll View Delegate not calling ScrollViewDidEndScrollingAnimation

安稳与你 提交于 2019-11-27 13:29:13
问题 I have implemented the UIScrollViewDelegate protocol in my .h file and i have implemented the - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView method in my .m class. when the scrolling is done in my table view other delegate method of scrollview are getting called, but when scrolling ends, -scrollViewDidEndScrollingAnimation: is not getting called. I am bit stuck in this. Thanks and regards 回答1: -scrollViewDidEndScrollingAnimation: is called when a programmatic-generated

In iOS 4.0, why does UIScrollView zoomToRect:animated: not trigger the scrollViewDidScroll or scrollViewDidZoom delegates while animating?

六月ゝ 毕业季﹏ 提交于 2019-11-27 12:03:22
问题 I need to closely monitor the scale of the scroll view so that I can update the content view's elements (a subview managing multiple CALayers ) according to the scroll view's animated zoom. On iOS 3.1, everything works as expected, I use zoomToRect:animated: and the scrollViewDidScroll: message of the UIScrollViewDelegate gets called repeatedly while the animation takes place , letting me update the subview elements according to actual zoom. The same code on iOS 4.0 does not exibit the same

UIScrollView, reaching the bottom of the scroll view

Deadly 提交于 2019-11-27 05:10:30
问题 I know the Apple documentation has the following delegate method: - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; // called when scroll view grinds to a halt However, it doesn't necessarily mean you are at the bottom. Cause if you use your finger, scroll a bit, then it decelerates, but you are not actually at the bottom of your scroll view, then it still gets called. I basically want an arrow to show that there is more data in my scroll view, and then disappear when you are