Reputation: 555
When showing and hiding the keyboard in my React Native app there is a white flickering where the keyboard goes, see this:
https://photos.app.goo.gl/Bwmin9T1R4OAO9tB3
I'm making my first app using React Native, so I'm not sure if this is "expected" behaviour (if this is just the way things look with React Native) or if there is anything I can do to fix it.
<KeyboardAvoidingView behavior="padding">
(I tried
removing it and still see the flickering).Keyboard
from "react-native" to listen to "keyboardDidShow" and "keyboardDidHide", and use Animated
from "react-native" to perform the animation on the icon.Upvotes: 5
Views: 3892
Reputation: 221
If your're using Expo, you can use a library called expo-system-ui
to set the background color:
import * as SystemUI from 'expo-system-ui';
//...
await SystemUI.setBackgroundColorAsync("black");
Upvotes: 0
Reputation: 70
using android:windowSoftInputMode="adjustPan"
fixed it for me.
Solution found in this comment.
Upvotes: -1
Reputation: 51
If you're using Expo and you're still having this issue, changing the softwareKeyboardLayoutMode
in the app.json
worked for me.
"android": {
"softwareKeyboardLayoutMode": "pan",
...(other properties)
}
Upvotes: 5
Reputation: 555
Updating to a newer version of create-react-native-app
which utilizes Expo seems to have fixed the issue.
Upvotes: 1