自动滚动 UIscrollview [英] Autoscrolling the UIscrollview

查看:24
本文介绍了自动滚动 UIscrollview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

同样的问题我已经问过几次了,但我没有答案.

I have already asked the same question a few time but I have had no answer.

我想知道是否有人可以帮助我获得一个 UIScrollview自动向下滚动页面,并且速度越来越快.

I would like to know if someone can help me get a UIScrollview to autoscroll down the page with an incrementally faster speeds.

我在页面上也有按钮.当用户触摸页面上的按钮时,它会保持自动滚动,这也很棒.所以,如果你有点理解它会像游戏Piano Tiles.

I also have buttons on the page. It would also be great when the user touches a button on the page it keeps autoscrolling. So if you kind of understand it will be like the game Piano Tiles.

我正在运行 Xcode 5.如果有人解决了我的问题,请告诉我代码在哪里,因为我是 Xcode 新手.

I am running Xcode 5. If someone has the solution to my problem please can you tell me what code goes where as I am quite a newby Xcode.

非常感谢您的帮助.:)

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.

您可以使用 SKNode 作为图层,而不是使用 UIScrollView,并将按钮添加到该父图层.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆