you can use UICategory class for UIView for that purpose. create different methods for set borders
, border colors
, pass bazier-paths
, corner
radius
and so many . this is just few of them. category is of UIView so you can use on buttons
,lables
,textview
,textedits
etc;
UIView+category.h
@interface UIView (category)
-(void)makeToRoundEdgeWithBorder:(CGFloat )borderwidth bordecolor:(UIColor *)color;
@end
UIView+category.m
@implementation UIView (category)
-(void)makeToRoundEdgeWithBorder:(CGFloat )borderwidth bordecolor:(UIColor *)color
{
NSLog(@"height %f width %f",CGRectGetHeight(self.frame),CGRectGetWidth(self.frame));
self.layer.cornerRadius=CGRectGetHeight(self.frame)/2;
self.layer.masksToBounds=YES;
self.layer.borderColor=[color CGColor];
self.layer.borderWidth=borderwidth;
}
@end
Use it
[yourlable makeToRoundEdgeWithBorder:0.0f bordercolor:[UIColor clearColor] cornerRadius:8.0f];
[yourbutton makeToRoundEdgeWithBorder:0.0f bordercolor:[UIColor clearColor] cornerRadius:8.0f];
[yourTextview makeToRoundEdgeWithBorder:0.0f bordercolor:[UIColor clearColor] cornerRadius:8.0f];
[yourTextfield makeToRoundEdgeWithBorder:0.0f bordercolor:[UIColor clearColor] cornerRadius:8.0f];