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 just is pressable text. What do I do? I am planning on releasing this app later, if that is relevant.
Is there an easy way to achieve this in Android? Yes, today there is, and it is very simple. Just use the MaterialButton in the Material Components library with the app:cornerRadius attribute. It is enough to obtain a Button with rounded corners.
Set an aspect ratio constraint (width == height) so that your button is square. Then move the code button. layer. cornerRadius = ... to an override of viewDidLayoutSubviews .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With