react-native-system-navigation-bar
react-native-system-navigation-bar copied to clipboard
setNavigationColor('transparent') will make `KeyboardAvoidingView` not work
Hi, I found an issue that when I use KeyboardAvoidingView
after call setNavigationColor('transparent')
, KeyboardAvoidingView
will not work.
After some debugging, I found it is caused by:
view.setFlags(
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
);
I am not very familiar with Android development. Is there a way to keep the effect of setNavigationColor('transparent')
, but also make KeyboardAvoidingView
works properly?
Hi, can you share screenshots with and without KeyboardAvoidingView
?
with and not setNavigationColor('transparent'):
without KeyboardAvoidingView
:
I made changes for this issue, you can find it in the latest version.
Hi @kadiraydinli, seems like this issue is still present in version 2.6.1
(only on Android)
Any tips to make it work? I am using height
as the behavior of the KeyboardAvoidingView
RN version: 0.71.8
Hey @kadiraydinli, any updates on this?
Hey @ale-mazz, can you explain this issue in more detail with screenshots and sample code?
@kadiraydinli Sure! (Sorry for the delay)
If I use SystemNavigationBar.setNavigationColor('transparent', undefined, 'navigation')
, the result obtained is this one
https://github.com/kadiraydinli/react-native-system-navigation-bar/assets/15525839/8cfb4283-fa77-42bd-8f56-f147aff3e5c8
If I use SystemNavigationBar.setNavigationColor('white', undefined, 'navigation')
, the result is this one. Note, I am using the standard KeyboardAvoidingView
provided by React Native
https://github.com/kadiraydinli/react-native-system-navigation-bar/assets/15525839/bbb6137b-6016-427c-b161-e386cc633c92
The correct behavior should be as in the second video, that is, the keyboard should push up the purple button. I want to specify that I am using this method only on Android, since on iOS I do not have to change the color of the navigation bar.
I cannot give you parts of the code I am using (company policy) but to sum up, I am using a SafeAreaView
, inside it I am using a KeyboardAvoidingView
, inside it a Scrollview
and at the same level of the Scrollview
a Pressable
I tried looking at your library but honestly could not solve the problem. I hope you can help me. Thank you!
Hey @ale-mazz, thank you for the explanation. I am working on it. I'll let you know when there's an improvement. 👍🏼
Hi @ale-mazz, despite my research and attempts, I couldn't find a healthy solution. I believe this issue is partially rooted in Android. Unfortunately, I cannot provide a fix for this problem at the moment. If you have a solution for this issue, please don't hesitate to open a PR. Thanks you.
Thanks, @kadiraydinli, since I'm not that comfortable with Android native development, I found a solution using Expo's packages. Thanks anyway!