1

How can we make a rounded rectangle frame programatically, as solved with

buyButton.layer.cornerRadius = 2;
buyButton.layer.borderWidth = 1;
buyButton.layer.borderColor = [UIColor blueColor].CGColor;

in iOS 7 round framed button

but resulting in a golden ratio corner such as the one introduced in the iOS 7 icon shape; new icon shape in iOS 7
iOS 6 and 7 icon difference?

Community
  • 1
  • 1
Peter V
  • 2,478
  • 6
  • 36
  • 54

2 Answers2

5

If you want the same shape, just measure the image, eg with Photoshop and set the border radius proportional to the button's width. I did the measurement for you:

buyButton.layer.borderRadius = 0.315 * buyButton.frame.size.width;

I don't think it follows golden ratio thought. If it does, the ratio should be (1 - (sqrt(5) - 1)/2), which is 0.381..., which results in too rounded corners.

Khanh Nguyen
  • 11,112
  • 10
  • 52
  • 65
1

There's more to the golden ratio in this template. It appears in the relative sizes of the circles in relation to each other and the width of the template. See http://www.phimatrix.com/product-design-golden-ratio/ for details.