Ian
Ian

Reputation: 23

trouble with rounded rectangles in Xcode 6

I'm a noob having trouble rounding the corners of my buttons using interface builder in Xcode 6. I added a new User Defined Runtime Attribute (layer.cornerRadius) as per the below instructions: https://stackoverflow.com/a/25164977/2903220

Unfortunately when I run the app there is no change in the button.

All other answers I've found say to do the same thing, yet it's not working. My questions is are there other settings I should check which may cause this to not work? (maybe it's better to do it programatically?!)

Please help! Thanks!

Upvotes: 0

Views: 62

Answers (2)

Jaswanth Kumar
Jaswanth Kumar

Reputation: 158

button.clipsToBounds = YES;

button.layer.cornerRadius = 20;//half of the width

button.layer.borderColor=[UIColor redColor].CGColor;

button.layer.borderWidth=2.0f;

Upvotes: 1

Ian
Ian

Reputation: 23

Checking Clip Subviews in the attributes inspector solves the issue.

Upvotes: 0

Related Questions