How do I create a grid of icons like the iPhone home screen?

前端 未结 6 1090
悲哀的现实
悲哀的现实 2021-01-30 11:58

How should I go about creating a UI similar to the Springboard (home screen) on the iPhone? I\'d like a grid of evenly spaced buttons with images where I can respond to the butt

6条回答
  •  没有蜡笔的小新
    2021-01-30 12:27

    I've written some sample code to do something like this. See my Tiles blog entry, or just download the code: Tiles-v1.0.zip.

    My code creates the icons as Core Animation layers, not as UIViews, but does demonstrate how to detect taps and allow reorganization of the icons. It doesn't handle orientation changes.

提交回复
热议问题