Autoscrolling the UIscrollview [duplicate]

2019-09-02 01:21发布

This question already has an answer here:

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条回答
Animai°情兽
2楼-- · 2019-09-02 02:10

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.

查看更多
登录 后发表回答