Axel Kennedal
Axel Kennedal

Reputation: 555

Keyboard white flickering with React Native

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.

Upvotes: 5

Views: 3892

Answers (4)

jhoffi
jhoffi

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");

Docs

Upvotes: 0

Hamouda Arfaoui
Hamouda Arfaoui

Reputation: 70

using android:windowSoftInputMode="adjustPan" fixed it for me.

Solution found in this comment.

Upvotes: -1

Uziel Perez
Uziel Perez

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

Axel Kennedal
Axel Kennedal

Reputation: 555

Updating to a newer version of create-react-native-app which utilizes Expo seems to have fixed the issue.

Upvotes: 1

Related Questions