Skip to content

react-navigation #82

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

Closed
gif- opened this issue Jan 13, 2019 · 4 comments
Closed

react-navigation #82

gif- opened this issue Jan 13, 2019 · 4 comments

Comments

@gif-
Copy link

gif- commented Jan 13, 2019

Hi! I'm using the createBottomTabNavigator (from react-navigation) call to create a tab navigator and one tab contains the UnityView component. If I navigate to the tab containing the unity view, it loads correctly, but once I navigate away, all of the remaining tabs content will become black. (tested with run-android)
However I can go back to the unity tab and it loads again, but none of the previously working tabs show anything but a black screen.

It seems however, when I put an Alert.alert('something') into the render() function, the screen is somehow forced to redraw correctly.

Yet stranger, if I enable the Inspector in the debug menu, everything starts to work even without calling Alert.alert() in render(). I guess the overlaying inspector gui forces the content to be redrawn on each frame.

I also tried to catch willFocus/willBlur and call setState from there to hide the unity view, but without any luck.

@f111fei : Can you please check/verify this?

@f111fei
Copy link
Owner

f111fei commented Jan 14, 2019

What‘s your UnityView style? If UnityView is full-screen in Android, there will be some rendering problems.

Try change UnityView style.

<UnityView style={{ position: 'absolute', left: 0, right: 0, top: 1, bottom: 1 }} />

@gif-
Copy link
Author

gif- commented Jan 14, 2019

Geez, I've been fiddling around for days with it, and that solved it instantly. Thanks a bunch!

@ziyoshams
Copy link

I have another kind of issue with bottom tab navigation. My system action sheet or alerts only pop up in Unity View window not in other tabs. Any suggestion or workarounds?

@ddaeschler
Copy link

@f111fei 's suggestion solved my problem as well. I was using flex: 1 to size the unity container. Thanks!

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

4 participants