在UIScrollview中自动滚动 [英] Autoscrolling in a UIScrollview
问题描述
我现在只使用Xcode 5了一段时间,在自动滚动UIScrollView
时需要帮助.我正在使用单视图应用程序.我需要屏幕以递增的速度向下滚动.另外,即使触摸屏幕,我也需要屏幕保持进度.如果有人可以解释将哪个代码放到哪里,那就太好了!对你的帮助表示感谢. :)
I have been only using Xcode 5 for a little while now and I need help when it comes to auto scrolling a UIScrollView
. I am using a single view application. I need the screen to scroll down at a pace that speeds up incrementally. Also I need the screen to keep progressing even when the screen is touched. If someone can explain which code goes where it would be great! Your help will be greatly appreciated. :)
推荐答案
好,只需从您的重复的问题中添加.
我怀疑 Piano Tiles 游戏实际上使用的是Sprite Kit
之类的东西.
I suspect the Piano Tiles game is actually using something like Sprite Kit
.
这允许对滚动"速度之类的东西进行更多控制.
This allows a lot more control over thing like "scrolling" speed.
代替使用UIScrollView
,您可以使用SKNode
作为图层,并在其父图层上添加按钮.
Instead of using a UIScrollView
you would use an SKNode
as a layer with the buttons added to that parent layer.
然后使用update
游戏循环,您可以根据自游戏开始以来的时间来逐渐提高移动速度.
Then using the update
game loop you can incrementally increase the speed of the movement based on the time since the game started.
本质上...不要使用UIScrollView
,不要使用UIKit
,请使用SpriteKit
.
In essence... don't use UIScrollView
, don't use UIKit
, use SpriteKit
.
这篇关于在UIScrollview中自动滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!