objective c - How to set UITextField border/CALayer border ios on three sides only -


i need border textfield following image.how can that?

enter image description here

try these.. hope helps...

uitextfield *txt=[[uitextfield alloc]initwithframe:cgrectmake(10, 100, 150, 30)]; [txt setbackgroundcolor:[uicolor clearcolor]]; [txt setplaceholder:@"hello friend"]; [self.view addsubview:txt];   calayer *border = [calayer layer]; cgfloat borderwidth = 2; border.bordercolor = [uicolor redcolor].cgcolor; border.frame = cgrectmake(0, -2, txt.frame.size.width, txt.frame.size.height); border.borderwidth = borderwidth; [txt.layer addsublayer:border]; txt.layer.maskstobounds = yes; 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -