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

UIView together shadow and corners #346

Open
luxystech opened this issue Mar 31, 2016 · 2 comments
Open

UIView together shadow and corners #346

luxystech opened this issue Mar 31, 2016 · 2 comments
Labels

Comments

@luxystech
Copy link

I'm using NUI for my project and trying to apply properties for UIView the shadow and corners together it doesn't work.

ViewWithShadow{
corner-radius: 5;
shadow-color: #e6e6e6;
border-color: #e6e6e6;
border-width: 1,3;
shadow-offset:2,2;
shadow-opacity: 80;
shadow-radius:2;
}

It shows me only borders. If I comment first line - I see the shadow

ViewWithShadow{
    /*corner-radius: 5;*/
    shadow-color: #e6e6e6;
    border-color: #e6e6e6;
    border-width: 1,3;
    shadow-offset:2,2;
    shadow-opacity: 80;
    shadow-radius:2;
    }

Appreciate in advance for any cheats with NUI.

@chgandm
Copy link

chgandm commented Apr 6, 2016

This is due to the application of the radius automatically setting masksToBounds to YES for the view's layer. What I ended up doing is define a hierarchy of views, with the outer wrapper view defining the shadow and a clear background color, and the inner content view defining the corner radius:

  Outer {
    background-color: clear;
    shadow-color: #000000;
    shadow-opacity: 0.25;
    shadow-radius: 5;
  }

  Inner {
    background-color: #AAAAAA;
    corner-radius: 5;
  }

@luxystech
Copy link
Author

Thanks, will try

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

No branches or pull requests

3 participants