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

模擬 UIScrollView 減速

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

問題描述

我有一個 UIPanGestureRecognize 用于更改視圖的框架.當手勢的狀態(tài)為 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
                     }
                 }];
}

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

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 場會議,使用滾動視圖增強用戶體驗",介紹了一種使用滾動視圖的行為和感覺"來設(shè)置滾動視圖位置動畫的方法不同的視圖(滾動視圖實際上對用戶不可見).

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 匹配,現(xiàn)在和永遠.

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

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

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

相關(guān)文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設(shè)置滾動視圖內(nèi)容大小)
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 構(gòu)建會導致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創(chuàng)建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: 精品国产不卡一区二区三区 | 国产日韩视频 | 亚洲一区在线日韩在线深爱 | julia中文字幕久久一区二区 | 欧美日韩国产一区二区三区 | www.一区二区三区 | 国产天天操 | 欧美色综合天天久久综合精品 | 热久久999| 日韩一区二区在线视频 | 毛片韩国| 91豆花视频 | 国产精品中文字幕一区二区三区 | 黄色av网站在线观看 | 99九色| 日本羞羞影院 | 久久久成人精品 | 亚洲欧美日韩国产综合 | 青青草综合| 欧美一区二区三区四区视频 | 成人欧美日韩一区二区三区 | 国产精品一区二区三区在线 | 久久99国产精一区二区三区 | 国产精品久久久久久妇女 | 亚洲天堂中文字幕 | 日韩成人免费av | 亚洲成人精品免费 | caoporon| 国产精品一区二区久久久久 | 成人动慢 | 欧美精品久久久久久 | 亚洲狠狠爱 | 国产精品一二区 | 成人av观看 | 伊人精品一区二区三区 | 91精品国产91久久综合桃花 | 日韩视频一区二区 | 欧美美女一区二区 | 欧美极品视频 | 精品欧美乱码久久久久久 | 欧美自拍另类 |