I want UIScrollView to scroll fast after fast sweep, like this. Although, when paging is turned on, the scroll works one page at a time. Is it possible to scroll fast, when paging is enabled with a flick of a finger without manually implementation using gesture recognizers?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
This is fairly straightforward, however you must implement the paging aspect yourself (which is fairly simple). You don't need gesture recognizers.
Swift
First, adjust your UIScrollView deceleration rate:
Assume we have an array of content — let's call it
yourPagesArray
. In your UIScrollViewDelegate, implement the following method:You will also need to implement the following delegate method, to handle the case where the user lifts their finger gently without causing any scroll deceleration:
(Update: you may not need to do this under the latest iOS SDK. It seems like the above delegate method is now called when there is zero velocity.)
Objective-C
Setting your deceleration rate:
Then your scroll view delegate implementation:
I think we can set scrollView.userInteractionEnabled = NO when our finger touch it. And then when the animation is stop ,open it .It works for me. Hope it will help you.