how would one replicate the effect on the iPhone when you rearrange app icons? It would need to avoid collisions and rearrange the UIViews while snapped to a grid.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- how do you prevent page scroll in textarea on mobi
- Custom UITableview cell accessibility not working
相关文章
- Could I create “Call” button in HTML 5 IPhone appl
- Unable to process app at this time due to a genera
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
- Open iOS 11 Files app via URL Scheme or some other
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- Can not export audiofiles via “open in:” from Voic
- XCode 4.5 giving me “SenTestingKit/SenTestKit.h” f
Check out the MoveMe sample project in the SDK to see a basic example of dragging and animation.
You'll have to implement the logic yourself to figure out where to move the icons based on the geometry of your grid and the progress of the drag operation. Once you know where the icons need to go, animating the views only requires a few lines of code. You'll want to do something like this:
Read the sub-section titled, "Animating Views" under "Window and Views" in the iPhone Application Programming Guide. Then check out the methods in the UIView class reference under the heading, "Animating Views".
I've written some sample code to do something like this.
See my blog entry: Tiles, and the associated GitHub repository.