Xcode 5 Round Rect Buttons

后端 未结 7 523
借酒劲吻你
借酒劲吻你 2021-01-30 06:56

I have an app that incorporates many round rect buttons. However, in xcode 5, those dont exist. How do I get the round rect buttons back? They are essential to my app. Now it ju

7条回答
  •  庸人自扰
    2021-01-30 07:23

    1. Open the storyboard and choose the button you want to change.
    2. Open the Identity Inspector in the Utility Panel (right panel, 3rd button on top).
    3. Add (+) a new User Defined Runtime Attribute -- Key Path: layer.cornerRadius, Type: Number, Value: {integer}.

    The higher the number, the more rounded the corners. 50 is a circle for a standard button (or width/2). You won't see the change in the storyboard, but it will show at runtime.

    Screenshot of added attribute

提交回复
热议问题