On the right panel editor, there are all the characteristics from the button. But I want to know if there is an option to round the corners of the button in this panel.
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
In recent versions of iOS a button just shows the text.
It doesn’t pay attention to the corner radius. If you set the background color to something other than transparent then it gets filled with that color.
If you want a colored rounded rectangle, set the background color, and go to the identity inspector and add an entry under "user defined runtime attributes" with a key of "layer.cornerRadius" and a number value of 5.
You could extend UIButton and use
@IBInspectable
to be able to set the corner radius more comfortably. I added some math so that the Button can be at max a circle and always looks pleasing.@IBDesignable
is used that the button is able to render nicely in the Storyboard.