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

UIScrollView scrollRectToVisible 以自定義速度

UIScrollView scrollRectToVisible at custom speed(UIScrollView scrollRectToVisible 以自定義速度)
本文介紹了UIScrollView scrollRectToVisible 以自定義速度的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有一個(gè) UIScrollView,我在上面調(diào)用 scrollRectToVisible:animated:YES.我想設(shè)置動(dòng)畫的速度.可以嗎?

I have a UIScrollView and I'm calling scrollRectToVisible:animated:YES on it. I would like to set the speed at which it is animated. Can that be done?

推薦答案

我最終找到了解決方案.就我而言,滾動(dòng)在啟動(dòng)后以編程方式進(jìn)行動(dòng)畫處理,以模仿老虎機(jī)(帶有 3 個(gè)水平 UIScrollView).正在使用 scrollRectToVisible:animated: 方法執(zhí)行此操作.

I ended up finding a solution. In my case, the scrolling was animated programmatically after launch, to mimic a slot machine (with 3 horizontal UIScrollViews). Was doing this with the scrollRectToVisible:animated: method.

我必須使用 UIView 的 beginAnimation 設(shè)置自定義速度:

I got to set a custom speed using UIView's beginAnimation:

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:(abs(rMid-pMid)*0.3)];
scrollMid.contentOffset = CGPointMake(rMid*320, 0);
[UIView commitAnimations];

AnimationDuration 取決于滾動(dòng)條在每個(gè)繪圖"之間移動(dòng)的距離.

AnimationDuration depends on the distance the scroller has to move between each "drawing".

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

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

相關(guān)文檔推薦

how to set scrollview content size in swift 3.0(如何在 swift 3.0 中設(shè)置滾動(dòng)視圖內(nèi)容大小)
Stop a UITableView from automatically scrolling(阻止 UITableView 自動(dòng)滾動(dòng))
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 模擬器上運(yùn)行時(shí),使用 iOS 6.0 SDK 并為 iOS 5 Target 構(gòu)建會(huì)導(dǎo)致 UIScrollView setMinimumZ
Create partial-screen UIPageViewController programmatically(以編程方式創(chuàng)建部分屏幕 UIPageViewController)
how to make an ImageView zoomable with or without ScrollView.?(如何使用或不使用 ScrollView 使 ImageView 可縮放?)
主站蜘蛛池模板: www国产亚洲精品久久网站 | 超碰97人人人人人蜜桃 | 国产超碰人人爽人人做人人爱 | 不卡一区二区三区四区 | 欧美女优在线观看 | www.色.com| 四色永久 | 中文字幕人成乱码在线观看 | 中文字幕 欧美 日韩 | 自拍亚洲 | 国产精品视频一 | 羞羞视频免费在线 | 国产美女一区二区 | 色综合色综合 | 国产视频一区二区 | www.久| 精品久久久网站 | 国产乱码精品一品二品 | 综合激情av | 国产激情一区二区三区 | 天堂久久av | 日韩2020狼一二三 | 天天操天天干天天爽 | 91久久国产综合久久 | 精品网站999 | 日韩精品免费在线观看 | 欧美在线观看免费观看视频 | 久久久国产精品网站 | 色性av | 欧美一区二区三区 | 色婷婷av一区二区三区软件 | 国产乱精品一区二区三区 | 中文在线播放 | 国产中文区二幕区2012 | 日韩资源| 欧美日韩视频在线 | 久久久国产一区二区三区 | 亚洲精品福利在线 | 色小姐综合网 | 免费视频一区二区 | 亚洲综合色自拍一区 |