button corner radius is not working in iOS

Viewed 4775

I give button corner redius using below code but it is not wokring

button.layer.cornerRadius = 3
button.layer.borderWidth = 1

This code is not working.Please help me

5 Answers

Add the following line of code before the mentioned two statements.

buttonProfile.clipsToBounds = true
buttonProfile.layer.cornerRadius = buttonProfile.frame.size.width / 2
Related