iOS 7 round framed button
If you are a big fan of using storyboards for your UI design with iOS.. you can set the corner radius (and whichever other parameters as mentioned in dima's answer -- although unfortunately not the color, since it's a CGColor and Apple presently does not have that option in the popup) in the identity inspector
->user defined runtime attributes
in storyboard as shown here:
bonus:
you use runtime attributes for UIButton
placeholder text color (see here) and to change fonts of UILabel
, UITextField
and UIButton
as well (see here)
For standard iOS control elements like UIButton
, UILabel
,
you should use the UIView
tintColor
property:
buyButton.layer.borderColor = buyButton.tintColor.CGColor;
You can manipulate the CALayer of your button to do this pretty easily.
// assuming you have a UIButton or more generally a UIView called buyButton
buyButton.layer.cornerRadius = 2;
buyButton.layer.borderWidth = 1;
buyButton.layer.borderColor = [UIColor blueColor].CGColor;
// (note - may prefer to use the tintColor of the control)
you can tweak each of those to get the color and border effect you want.
You will also have to add an import in any file you want to use CALayers
#import <QuartzCore/QuartzCore.h>