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. :)
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
OK, just adding this from your duplicate question.
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 anSKNode
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 useUIKit
, useSpriteKit
.I can see a few options:
1) suggested by Fogmeister, use Sprite Kit instead.
2) see setContentOffset
3) just use a normal view as parent, then have another child view on top with the full content (would be longer than the parent view), create a NSTimer to periodically call a method which scrolls the child view in whatever direction and speed as required. Note that might need something on top to mask around the child view from showing the suppose-to-be-hidden sections of the child view.
Hope this helps
Check out this library: https://github.com/danielamitay/DAAutoScroll
It stops to scroll when the user touches the screen and that's the only solution I see possible. I don't even see why you wouldn't want the user to be able to stop the scrolling..