mprivat
mprivat

Reputation: 21902

how to make round buttons like the iOS 7 lock screen

Is there a predefined widget to make have round buttons in iOS7 like with the lock screen? I've been looking around at UIButton but I couldn't find anything. So their they're not UIButtons, or I'm not seeing it, or they just don't exist and I have to make my own custom buttons.

Upvotes: 3

Views: 8394

Answers (1)

Michael
Michael

Reputation: 427

Link the framework in build steps then

Import:

#import QuartzCore/QuartzCore.h

Code:

self.fiveButton.layer.cornerRadius = self.fiveButton.bounds.size.width/2.0;
self.fiveButton.layer.borderWidth = 1.0;
self.fiveButton.layer.borderColor = self.fiveButton.titleLabel.textColor.CGColor;
self.fiveButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:35];

This isn't exactly right: I don't have the label moved up (there are inserts for that) and I haven't figured out the exact font, but it's almost there.

https://github.com/langford/RoundButtonDemo/blob/master/screenshot.png

[email protected]:langford/RoundButtonDemo.git

Upvotes: 13

Related Questions