Man of One Way
Man of One Way

Reputation: 3980

Images for buttons in iPhone

Do I have to create (or download) images for iPhone UIButton's? I want a standard button with the iPhone look, but right now, all I can choose between are

NOTE: I believe it was possible to download some image library from Apple before with standard buttons and so on.

Upvotes: 1

Views: 1250

Answers (6)

AlburnBinkley
AlburnBinkley

Reputation: 19

You should check out Ray Wenderlichs tutorials. He has a long explanation of making buttons look awesome with core graphics. Best for reusability.

http://www.raywenderlich.com/tutorials

Upvotes: 1

rohan-patel
rohan-patel

Reputation: 5782

You can download icons as PNG or other files and set it to Button's Image..They maybe free or charga

Upvotes: 0

Deeps
Deeps

Reputation: 4577

For the given image. You need to make image like that and need to use button type as custom.

UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
 [button setImage:[UIImage imageNamed:@"customImageName.png"] forState:UIControlStateNormal];

You can also define image from Interface builder.

Upvotes: 0

Martin
Martin

Reputation: 1135

You can use any image you want but you have to use a custom button type like :

     UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
     [button setImage:[UIImage imageNamed:@"myimage.jpg"] forState:UIControlStateNormal];
     [button addTarget:self action:@selector(anAction:) forControlEvents:UIControlEventTouchUpInside];
     [self.view addSubview:button];

Upvotes: 0

damacri86
damacri86

Reputation: 295

No you don't. You only have to declare the botton like a Round Rect one and this is all :)

Upvotes: 0

Andy A
Andy A

Reputation: 4301

If you are using Interface Builder (or infact even if you are not!), the button types under 'type' should give you the default button types to get the Apple look. Adding your own images would be unconventional.

Upvotes: 1

Related Questions