Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cornerRadius and shadow BUG #2

Open
CavalcanteLeo opened this issue Dec 8, 2018 · 3 comments
Open

cornerRadius and shadow BUG #2

CavalcanteLeo opened this issue Dec 8, 2018 · 3 comments

Comments

@CavalcanteLeo
Copy link

CavalcanteLeo commented Dec 8, 2018

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 CavalcanteLeo changed the title cornerRadius and shadowColor BUG cornerRadius and shadow BUG Dec 8, 2018
@tungvoduc
Copy link
Owner

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

@CavalcanteLeo
Copy link
Author

it is, the code works perfectly

@tungvoduc
Copy link
Owner

@CavalcanteLeo I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants