Outer glow for UIView
3 answers
You can add a custom subview to your UIView that extends outside of your UIView. For example:
UITextView* mainView = [[UITextView alloc] initWithFrame:CGRectMake(50, 50, 100, 100)];
mainView.clipsToBounds = NO;
// Add 5 px of padding to the mainView bounds
CGRect borderFrame = CGRectInset(mainView.bounds, -5, -5);
MyBorderView* borderView = [[MyBorderView alloc] initWithFrame:borderFrame];
customView.userInteractionEnabled = NO;
[mainView addSubview:customView];
MyBorderView
can draw border in your method -drawRect:
, or you can use UIImageView.
+4
source to share