-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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] React ART can't drawing the line dynamic. #14330
Comments
I've had a similar problem on Android with the Surface and Shape. They have worked fine on IOS but behave differently on Android. When I generate and draw a path, it works correctly on the first render. Unfortunately when pressing the sleep button to put the phone to sleep and then moving back to the app, the path has disappeared. I haven't been able to reproduce this in the Android Emulator, but it happens consistently when running on my device (a galaxy S8). I don't know what to do with this. |
|
I have the similar problem |
@jiarWang It seems that 0.47.1 fix this bug, you can test it. |
@guoliang1206 thank U, it did work |
@kyledmellander Have you solved your problem ?I met the same issue. |
@alwaysonlinetxm I ended up using a webview / canvas. It was pretty janky. I had luck with the react-native-svg library. I think a lot of it is that we're stuck in dependency hell with a react native 0.45.1 |
@kyledmellander I found a tricky way to handle this issue. I observed the screen and remount the when the screen became active from background. It worked, but the problem is it will lead to a blink on the screen. |
@kyledmellander I ran into the same issue where a element would disappear if the app was backgrounded on android, and not redraw when the app was woken again even if a forceUpdate was called. Have been able to fix it by in a similar way to @alwaysonlinetxm by using AppState to watch for background/foreground changes. But, instead of re-mounting the component I set a |
I have used the panResponder to catch the points moved on the screen ,draw the path and display it. It is works well on iOS, but it doesn't works on Android.
Here is the code:
process the points
render method:
This is it works on iOS, when I touch and moved ,it will display the line . and the points object will be correctly display ,notice the text : initial -> [Object object]
![drawer_ios](https://cloud.githubusercontent.com/assets/12846676/26811483/c7db7df2-4aa4-11e7-9141-767a1f128df0.gif)
And this is it works on Android, we can see that the text will be changed to [Obejct objetct] ,but it can't display the line.
![drawer_android](https://cloud.githubusercontent.com/assets/12846676/26811806/9c719f64-4aa6-11e7-98a2-267ee439e634.gif)
If i change the path like this:
<Shape d={"M160 160 A 45 45, 0, 0, 1, 115 205"} stroke={'rgb(0,185,255)'} strokeWidth={this.nowR} />;
, then it will draw an arc when first render on android.is it a bug? or something important but ignored by me?
and attach the env of my demo.
The text was updated successfully, but these errors were encountered: