Use the button's layer's properties:
yourButton.layer.borderWidth = 3.0f;
yourButton.layer.borderColor = [UIColor colorWithRed:178/255.0 green:170/255.0 blue:156/255.0 alpha:0.4].CGColor;
(Change the values so it looks good, alpha makes it semi-transparent)
Also, you'll need this if you don't have the circle yet:
yourButton.layer.cornerRadius = yourButton.frame.size.width/2;
EDIT: As @holex suggested, a better way to calculate the cornerRadius is:
CGFloat radius = MIN(yourButton.frame.size.width, yourButton.frame.size.height) / 2.0
yourButton.layer.cornerRadius = radius;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.