I am drawing mask path on UIView
to make it look like a rectangle at a particular point of view. I want to set corner radius for the mask path so that it can appear as bulged at the side like popover of iOS. Any idea how to implement.
Thanks
I am drawing mask path on UIView
to make it look like a rectangle at a particular point of view. I want to set corner radius for the mask path so that it can appear as bulged at the side like popover of iOS. Any idea how to implement.
Thanks
Use this Code,
Objective C code:
// Cornor radius
[view.layer setCornerRadius:30.0f];
view.layer.masksToBounds = YES;
// border
[view.layer setBorderColor:[UIColor lightGrayColor].CGColor];
[view.layer setBorderWidth:1.5f];
// drop shadow
[view.layer setShadowColor:[UIColor blackColor].CGColor];
[view.layer setShadowOpacity:0.8];
[view.layer setShadowRadius:3.0];
[view.layer setShadowOffset:CGSizeMake(2.0, 2.0)];
Swift Code:
// Cornor radius
view.layer.cornerRadius = 10.0
view.layer.masksToBounds = true
// border color and width
view.layer.borderColor = UIColor.blueColor().CGColor
view.layer.borderWidth = 2.0
// drop shadow
view.layer.shadowColor = UIColor.blackColor().CGColor
view.layer.shadowOpacity = 1.0
view.layer.shadowRadius = 3.0
view.layer.shadowOffset = CGSizeMake(2.0, 2.0)
hope its helpful