-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Shadow] Shadow does not appear if overflow: hidden is set #449
Comments
cc @sahrens If I remember correctly, it's not rendering shadows for phones that are not good enough and by default the simulator fits that. |
Maybe it's about 64-bit architecture, if that then it's related to: #448 Some images for this, the shadows is rendered fine on 4s, 5 but not 5s and 6: |
Shadow is NOT visible on iPhone 6 Shadow is visible on:
Shadow is NOT visible on
|
Our GPU fill-rate gating was only for some specific product code, and was no longer necessary after we switched to assets for shadows instead of the layer properties. There shouldn't be anything in the infra intentionally disabling shadows, probably just some sort of bug - cc @a2, @nicklockwood That said, I would recommend using assets instead of the shadow properties in general - they tend to perform much better on older devices.
|
The problem is the shadow properties only work on old devices, not the new On Monday, March 30, 2015, Spencer Ahrens notifications@github.com wrote:
Regards, |
👍 I noticed this today and would be happy to attempt to fix the bug if someone could point me in the right direction. |
as far as I get, |
according to [doc] (https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CALayer_class/#//apple_ref/occ/instp/CALayer/shadowRadius), shadowOpacity is type `float`.
What's the current state of this? |
I see the shadow now on the iPhone 5s simulator: https://rnplay.org/plays/6_nkSA Also see the shadow on the iPhone 6 device. @oisinlavery Still seeing this issue? |
I see the shadow on my iPhone 5s. Let's reopen this if anyone has the issue again. |
I found that the shadow disappears once I set |
The shadow typically displays outside the bounds of the view, so if you set
|
I expected it to clip the overflowing content of the view (like when you have rounded corners), but not the shadow. Apparently this is a very subjective expectation and having a container view for the shadow properties works just as well.
|
@mbrgm: our base reference to all of those questions is the web. Can you add a shadow and overflow hidden on a div in a jsfiddle and see what happens? |
@vjeux As I expected, the shadow is visible. |
Yeah, we should try to follow web where possible, but this might be kinda tricky - what do you think, @nicklockwood? |
@sahrens I agree, we should try to emulate CSS, as we do for all other aspects of border rendering. There's a fix I need to make to clipping that will fix this as a side effect anyway. The best solution in the meantime is to nest two views, with the shadow on the outer view and clipping on the inner view (this is basically what my fix will be, but it'll be done opaquely by the framework instead of explicitly). |
What's the status on this? |
I'm looking into addressing this, but it will take a while. FWIW, It's not a bug; this is how shadows are supposed to work on iOS, and there are fairly simple workarounds (nesting two views). But we would ideally like React to conform to the CSS spec here, so I'm working to make that happen. |
Sorry, I see I already said all that earlier ¯_(ツ)_/¯ |
Any updates on this? Thanks... |
No progress, I'm afraid. I'd still advocate the nested views approach for now. |
Hey folks, I'm moving this one over to ProductPains as per our new policy! Give it an upvote there if you believe this is an important fix: https://productpains.com/post/react-native/shadow-does-not-appear-if-overflow-hidden-is-set-on-ios/ In the meantime, feel free to use the approach that maestro @nicklockwood suggested above. I'm going to close the issue as there isn't much benefit to having it open here and on ProductPains. |
Any updates on that? Still experiencing it on iOS 10.3.3, iPhone 7, RN 0.47.1 |
Still happening today 😕 |
+1 |
iPhone 6, iOS 8.1.1
The text was updated successfully, but these errors were encountered: