ios - Custom UIButton rounder corners become squared on highlight? -


i have following code 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 highlight button becomes squared though has rounded corners in normal state.

any ideas?

try code work,

btnlogin.layer.cornerradius = 10.0; [btnlogin setclipstobounds:yes]; 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -