DTGradientButton icon indicating copy to clipboard operation
DTGradientButton copied to clipboard

cornerRadius and shadow BUG

Open CavalcanteLeo opened this issue 5 years ago • 3 comments

There is a bug when i use button.layer.masksToBounds = false I cant set it to true and use cornerRadius so I must set as false to use cornerRadius and shadowColor together

code (objective-c):

    self.button.layer.cornerRadius = 30;
    self.button.layer.shadowOffset = CGSizeMake(0, 10);
    self.button.layer.shadowColor = [UIColor blackColor].CGColor;
    self.button.layer.shadowRadius = 20;
    self.button.layer.shadowOpacity = 0.5f;
    self.button.layer.masksToBounds = NO;

CavalcanteLeo avatar Dec 08 '18 18:12 CavalcanteLeo

@CavalcanteLeo It is not possible to have layer.masksToBounds = false and layer.cornerRadius at the same time. You should google solution for this.

tungvoduc avatar Dec 09 '18 11:12 tungvoduc

it is, the code works perfectly

CavalcanteLeo avatar Dec 15 '18 00:12 CavalcanteLeo

@CavalcanteLeo I'll take a look.

tungvoduc avatar Dec 18 '18 08:12 tungvoduc