-
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
[Android] overflow visible doesn't work #6802
Comments
Overflow is not supported on Android: https://facebook.github.io/react-native/docs/known-issues.html#the-overflow-style-property-defaults-to-hidden-and-cannot-be-changed-on-android |
@ide the link is broken, is it still relevant? |
Still not working. Drawing outside a view on Android is nearly impossible... |
Are there any practical recommendations ? |
@aymericbouzy - I managed to get something similar to this behavior using elevation. Checkout the gist. |
Would it be possible to update the documentation to call this out? From what I see here in the docs, |
How is this issue closed? any solutions? |
I believe the interface you are showing can be obtained with absolute positioning. |
No he can't there is always a problem with zindex and ontouch methods it's very messy... |
can't you abstain from using zIndex and simply put objects in the order in which they should be displayed ? |
@aymericbouzy Unfortunately not, since you can't overlap views on Android. This really proves problematic for this kind of layout, particularly when soft shadows are involved. There are many issues at stake: no visible overflow (the real bummer), buggy z-indexes, absolute positioning randomness... Let me show you another example of a UI I am trying to implement, but for which I am currently clueless. On iOS, I would simply use negative margins or even absolute positioning with a global container; this would be pretty easy. But because of the overflow issue, neither of this classic methods will work on Android. Do you have any idea that would allow me to circumvent these limitations? |
@bd-arc I have absolutely no experience building such complex UI, and I'm not saying it's simple. The way I would go though would be the following : putting each view in a different layer, each layer being an absolute positioned view taking the full width and height of the display, and positioning the visible views inside each layer. Since each layer takes the full dimensions of the display, overflow is not a problem. I fully agree this solution is a pain, but I believe it works. Please tell me if I'm wrong :)
|
@aymericbouzy "each layer being an absolute positioned view taking the full width and height of the display" If you do that you won't be able to touch any button, or at least only the one with higher zIndex, even if you see the underlaying touchable element. |
@bd-arc you're right. Then you can add touchable views on the uppermost layer upon the visible parts, but the interface is not going to be very responsive ... this is definitely not a long-term solution. |
@aymericbouzy Unless I'm mistaken, you're solution is built on something that's pretty complicated: I don't see any reliable way of retrieving complex content's height, particularly before it is rendered (doing it after, assuming this would be both possible and reliable, would lead to jerkiness issues - believe me, I've been there :) I would rather go with clever margins and paddings, since this seems easier to maintain and would avoid touch issues (the ones that @jreziga stated above), but it would be an incredibly tedious task, with lots of limitations. Furthermore, that still leaves no room for soft shadows. And we haven't even talked about orientation change or responsiveness... |
@bd-arc indeed it is very complicated, and unmaintainable, and I wouldn't go this way on a general basis. I'm just saying this is the solution I've found for a much simpler use case than yours. |
im having a similar issue, im using position absolute to draw outside a view. also, setting hight on the view does the same. any suggestions? |
A property that's only supported in one OS is not very useful ... don't claim react-native supports it then. |
Been bitten by this multiple times, there should be a warning in RN if overflow: 'visible' is set on Android. |
I hate Android. It doesn't support normal shadows, blur and even overlapping now |
Any updates ..? |
There is a rewrite of Android's View library called Nodes. It supports overflow. It is still not ready yet but maybe will be later this year if it is a success. Check back later this year. |
I think some updates needs to be done on the document https://facebook.github.io/react-native/docs/layout-props.html that overflow dose not work on Android currently
|
Hey checkout this https://www.npmjs.com/package/react-native-zindex-views it would help you. |
Just looking for a little clarity, wouldn't Android's |
@Dygerati have you found out more about this? It looks like either |
Is this |
Reviewed By: shergin Differential Revision: D5917111 fbshipit-source-id: e3d97f26b6aada199f700ec6659ace0d7dffd4c5
The commit referenced above (30044fd) doesn't fixes this issue when using |
AFAIK it will fix overflow:hidden in case there is border radius defined. And about overflow:visible on android, it may be impossible to resolve because of android native views specific, but I can be wrong in this point |
Found a working link to Ide's original closure explanation. It's a wontfix: https://web.archive.org/web/20160702114556/http://facebook.github.io:80/react-native/docs/known-issues.html#the-overflow-style-property-defaults-to-hidden-and-cannot-be-changed-on-android |
RN50 overflow visible seems broken for me, even with something else than images. See #17074 |
Why does it always feel like android is just not a first class citizen in The way react-native is advertised in the readme
Doesn't come over with the way it actually functions at all, every time I am trying to build something for both platforms. Its super easy to do in iOS but for some reasons I require a ton of hacks to make things as trivial as this work on android. Now don't get me wrong, I think |
Still no updates on this? I literally have to redo a dumb-component from scratch because of this... just cuz Android. |
Any updates on this? |
Still no change? |
"Overflow" feature for Android won't be supported for next a few years. So find a tricky way to implement your design. |
+1 !!! |
I found this workaround - https://github.com/entria/react-native-view-overflow |
second view
{overflow: 'visible'}
The text was updated successfully, but these errors were encountered: