Custom UIButton rounder corners become squared on highlight?

button, ios, xcode

Solution

Try with this code it will work,

btnLogin.layer.cornerRadius = 10.0;
[btnLogin setClipsToBounds:YES];

Problem

I have the following code for a custom UIButton: ``` btnLogin.layer.cornerRadius = 10; [btnLogin setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"bluetint.png"]]]; [btnLogin setAlpha:1]; [btnLogin setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [btnLogin setBackgroundImage:[UIImage imageNamed:@"reallybluetint.png"] forState:UIControlStateHighlighted]; [btnLogin setBackgroundImage:[UIImage imageNamed:@"reallybluetint.png"] forState:UIControlStateSelected]; ``` When I highlight the button it becomes squared even though it has rounded corners in the Normal state. Any ideas?

Original source