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

如何使 UIScrollView 以一定的速度自動(dòng)滾動(dòng)?

How do i make a UIScrollView scroll automatically at a certain speed?(如何使 UIScrollView 以一定的速度自動(dòng)滾動(dòng)?)
本文介紹了如何使 UIScrollView 以一定的速度自動(dòng)滾動(dòng)?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我正在使用 touchesBegan 和 touchesMoved 來(lái)跟蹤用戶的交互,因此我可以看到用戶觸摸屏幕的位置.我想要做的是當(dāng)他們將手指移到屏幕的最后 20 個(gè)像素時(shí),讓 UIScrollView scroll1 向下滾動(dòng).但是我如何定義速度?當(dāng)然,while 語(yǔ)句會(huì)執(zhí)行得太快,而 UIView 動(dòng)畫(huà)會(huì)將其移動(dòng)到某個(gè)位置,但只會(huì)移動(dòng)一次.

I am using touchesBegan and touchesMoved to track a user's interaction, so I can see where the user has touched the screen. What I want to do is when they take their finger to the last 20 pixels of the screen, have the UIScrollView scroll1 to scroll down. But how do i define a speed? Surely a while statement would do it far too rapidly, and a UIView animation would move it to a certain place but only the once.

推薦答案

您可以通過(guò)以下代碼做到這一點(diǎn):

You can do this by the following code :

[UIScrollView beginAnimations:@"scrollAnimation" context:nil];

[UIScrollView setAnimationDuration:REQUIRED_ANIMATION_DURATION];

[scroll setContentOffset:CGPointMake(REQUIRED_DISTANCE_X, REQUIRED_DISTANCE_Y)];

[UIScrollView commitAnimations];

只需將 REQUIRED_ANIMATION_DURATION 的值設(shè)置為您想要的任何時(shí)間間隔.更小的時(shí)間間隔將意味著更快的速度.

Just set the values of REQUIRED_ANIMATION_DURATION to whatever time interval you want. A smaller time interval will mean faster speed.

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

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(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 可縮放?)
主站蜘蛛池模板: 欧美精品导航 | 国产一级视频免费播放 | 亚洲成人综合网站 | 欧美国产日韩精品 | 国产1区| 久久99精品久久久久 | 久久国产精品视频 | 久久久久成人精品免费播放动漫 | japanhd成人| 一级毛片免费 | 国产一区二区 | 国产午夜精品久久久 | 国产一区二区三区四区五区加勒比 | 中文字幕在线看人 | 久久婷婷国产香蕉 | 国产二区三区 | 高清视频一区二区三区 | 国产一级视频在线 | 亚洲一二三区精品 | 国产a区| 91精品观看 | 国产精品综合网 | 亚洲精品久久国产高清情趣图文 | 久久国产成人精品国产成人亚洲 | 国产亚洲一区二区三区在线观看 | 女同久久 | 97久久久| 久久精品二区 | 九九在线| 国产一区二区三区久久久久久久久 | 欧洲精品久久久久毛片完整版 | 久久尤物免费一区二区三区 | 精品九九九 | 亚洲国产精品久久 | 欧美性影院 | 亚洲视频在线播放 | 免费国产视频 | 狠狠躁躁夜夜躁波多野结依 | 久久久久中文字幕 | 亚洲一区二区三区视频 | 久久久黄色 |