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
Post a Comment