Add a border to any UIView
Adding a border to any UIView can be accomplished very simply by accessing the UIView underlying layer and setting the boderColor and borderWitdth attributes :
UIView *view = [[UIView alloc] init];
...
//Add a white border
view.layer.borderColor = [UIColor colorWithWhite:1.0f alpha:1.0f].CGColor;
view.layer.borderWidth = 1.0f; //make border 1px thick
Enjoy :)
Written by Cherif YAYA
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#