Autoscrolling the UIscrollview [duplicate]

狂风中的少年 提交于 2019-12-11 16:34:09

问题


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

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

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.

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.:)


回答1:


I suspect the Piano Tiles game is actually using something like Sprite Kit.

This allows a lot more control over thing like "scrolling" speed.

Instead of using a UIScrollView you would use an SKNode as a layer with the buttons added to that parent layer.

Then using the update game loop you can incrementally increase the speed of the movement based on the time since the game started.

In essence... don't use UIScrollView, don't use UIKit, use SpriteKit.



来源:https://stackoverflow.com/questions/24500234/autoscrolling-the-uiscrollview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!