iOS Adding Buttons using Storyboard

RagingGoat

macrumors 6502
Original poster
Jun 21, 2010
300
14
When adding buttons through a storyboard, how do you go about adding images on those buttons? I have images that will be our buttons but I'm not quite sure how to get them onto the buttons through storyboard.
 

iJustinCabral

macrumors member
Jul 8, 2012
58
0
In the accessibility window in the right column, change the button type to custom, and set your background image.

Pretty simple.
 

RagingGoat

macrumors 6502
Original poster
Jun 21, 2010
300
14
And just so I'm clear. The size for the buttons that xcode shows is in points, correct? Xcode shows my buttons as 102 x 104 so my images need to be 102 x 104 points.
 

RagingGoat

macrumors 6502
Original poster
Jun 21, 2010
300
14
One more quick question. When setting the background of the screen (behind the buttons) Can you select an image or does it have to just be a color? For example, my buttons are going to be images that when combined make up a larger image. Can the background be the rest of the image not included in the button images so that it looks like one image except for the space between buttons?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
You can have an image view that has your entire image and then arrange your buttons so they appear in front of the image view. Don't make the buttons subviews of the image view, just in front of it.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
One more quick question. When setting the background of the screen (behind the buttons) Can you select an image or does it have to just be a color? For example, my buttons are going to be images that when combined make up a larger image. Can the background be the rest of the image not included in the button images so that it looks like one image except for the space between buttons?
You CAN set a background image for your view, or add an image view that your buttons lie on top of, as the other poster suggested. However, rotating between landscape and portrait will screw you up, and so will the different screen sizes on the iPhone and iPad.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.