In iOS, a button can be represented by an image. Here’s how to add a new image to your Xcode project.
- In images.xcassets, add a new image set (right-click and choose New Image Set).
- Drag your images to the image set. Consider having different sizes for different purposes (retina screens vs older screens, and so forth).
- In Attribute Manager, view the object library and drug a button to the storyboard.
- Set the desired image to be the new graphic for the button (you must have the Assistant Editor selected and click on the Attributes Inspector in order to do this).
- On the storyboard, Ctrl-drag to create an action for the new button.
- Put code in the button’s new action.
No comments:
Post a Comment