Skip to content
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

setNavigationColor('transparent') will make KeyboardAvoidingView not work #38

Open
farmer00317558 opened this issue Jan 7, 2023 · 10 comments

Comments

@farmer00317558
Copy link

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?

@kadiraydinli
Copy link
Owner

Hi, can you share screenshots with and without KeyboardAvoidingView?

@farmer00317558
Copy link
Author

with and not setNavigationColor('transparent'):
image

without KeyboardAvoidingView:
image

@kadiraydinli
Copy link
Owner

I made changes for this issue, you can find it in the latest version.

@ale-mazz
Copy link

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

@ale-mazz
Copy link

ale-mazz commented Aug 9, 2023

Hey @kadiraydinli, any updates on this?

@kadiraydinli
Copy link
Owner

Hey @ale-mazz, can you explain this issue in more detail with screenshots and sample code?

@kadiraydinli kadiraydinli reopened this Aug 10, 2023
@ale-mazz
Copy link

ale-mazz commented Aug 16, 2023

@kadiraydinli Sure! (Sorry for the delay)

If I use SystemNavigationBar.setNavigationColor('transparent', undefined, 'navigation'), the result obtained is this one

Registrazione.schermo.2023-08-16.alle.11.26.55.mov

If I use SystemNavigationBar.setNavigationColor('white', undefined, 'navigation'), the result is this one. Note, I am using the standard KeyboardAvoidingView provided by React Native

Registrazione.schermo.2023-08-16.alle.11.28.44.mov

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!

@kadiraydinli
Copy link
Owner

kadiraydinli commented Aug 16, 2023

Hey @ale-mazz, thank you for the explanation. I am working on it. I'll let you know when there's an improvement. 👍🏼

@kadiraydinli
Copy link
Owner

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.

@ale-mazz
Copy link

ale-mazz commented Sep 6, 2023

Thanks, @kadiraydinli, since I'm not that comfortable with Android native development, I found a solution using Expo's packages. Thanks anyway!

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

3 participants