I donβt understand how to remove the shadow added to the view. I add a shadow to the view in initWithFrame as follows:
self.layer.borderWidth = 2; self.layer.borderColor = [UIColor clearColor].CGColor; self.backgroundColor = [UIColor greenColor]; [self.layer setCornerRadius:8.0f]; CALayer *layer = self.layer; layer.shadowOffset = CGSizeMake(2, 2); layer.shadowColor = [[UIColor blackColor] CGColor]; layer.cornerRadius = 8.0f; layer.shadowRadius = 3.0f; layer.shadowOpacity = 0.80f; layer.shadowPath = [[UIBezierPath bezierPathWithRect:layer.bounds] CGPath];
After running the application, I want to remove the shadow from this view. I tried using:
layer.hidden = YES;
or
self.layer.hidden = YES;
but it completely hides the view, not just the added shadow.
Is there a way to get the added shadow from the view and then hide it? Thanks!
ios uiview
Hw.master
source share