久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

模擬 UIScrollView 減速

Simulate UIScrollView Deceleration(模擬 UIScrollView 減速)
本文介紹了模擬 UIScrollView 減速的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 UIPanGestureRecognize 用于更改視圖的框架.當手勢的狀態為 UIGestureRecognizerStateEnded 時,有沒有辦法模擬 UIScrollViewUITableView 的減速?這是我當前的代碼:

I have an UIPanGestureRecognize which I use to change the frame of a view. Is there a way to simulate the deceleration of the UIScrollView or UITableView when the gesture's state is UIGestureRecognizerStateEnded? Here is my current code:

if (panGesture.state == UIGestureRecognizerStateEnded)
{
    [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
    self.view.frame = CGRectMake(182, 0, self.view.frame.size.width, self.view.frame.size.height);
}
                 completion:^(BOOL finished) {
                     if (finished) {
                        //Do something
                     }
                 }];
}

但這不是一個流暢的滾動.我想要一些能減速直到停止到我設定的點的東西.謝謝

but this is not a smooth scroll. I would like something that decelerates until it stops to the point I've set. Thanks

推薦答案

WWDC 2012 的第 223 場會議,使用滾動視圖增強用戶體驗",介紹了一種使用滾動視圖的行為和感覺"來設置滾動視圖位置動畫的方法不同的視圖(滾動視圖實際上對用戶不可見).

Session 223 at WWDC 2012, "Enhancing User Experience With Scroll Views", covered a method to use a scrollview's behavior and "feel" to animate the position of a different view (without the scrollview ever actually being visible to the user).

會話中顯示的方法的好處是您的減速將始終與 UIScrollView 匹配,現在和永遠.

The benefit of the method shown in the session is that your deceleration would always match UIScrollView's, now and forever.

https://developer.apple.com/videos/wwdc/2012/?id=223

這篇關于模擬 UIScrollView 減速的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設置滾動視圖內容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動滾動)
iOS UIScrollView Lazy Loading(iOS UIScrollView 延遲加載)
using iOS 6.0 SDK and building for iOS 5 Target causes UIScrollView setMinimumZoomScale to fail when running on iOS 5 simulator(在 iOS 5 模擬器上運行時,使用 iOS 6.0 SDK 并為 iOS 5 Target 構建會導致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: 狠狠操狠狠色 | 日韩欧美精品一区 | 成人免费网站www网站高清 | 国产成人精品a视频一区www | 成人精品啪啪欧美成 | 成人午夜影院 | 亚洲人va欧美va人人爽 | 午夜久久久久久久久久一区二区 | 韩日一区二区三区 | 国产99免费视频 | 国产区在线观看 | 99久久久国产精品免费消防器 | 亚洲高清在线观看 | 国产黄色大片在线免费观看 | 欧美午夜在线 | 国产成人jvid在线播放 | 欧美黄色网络 | 亚洲第一在线视频 | 人妖av | 欧美激情亚洲 | 在线观看av网站 | 免费视频二区 | 精品国产乱码久久久久久中文 | 国产欧美在线 | 精品自拍视频 | 亚洲视频中文字幕 | 亚洲综合一区二区三区 | a网站在线观看 | 羞羞视频网站免费观看 | 91免费视频 | 亚洲精品18 | 国产在线视频三区 | 欧美精品一二三 | 国产综合精品一区二区三区 | 成人国产在线视频 | 婷婷久久综合 | h片在线观看网站 | 99久久婷婷国产综合精品电影 | 久久久久久亚洲精品不卡 | 一级毛片在线播放 | 久久国产激情视频 |