wix-incubator / react-native-keyboard-input

Use your own custom input component instead of the system keyboard
MIT License
819 stars 150 forks source link

How to cover the content behind the iPhoneX safe area ? #66

Closed zcmgyu closed 6 years ago

zcmgyu commented 6 years ago

The input accessory view successfully avoids the home pill of iPhone X, but content behind the unsafe area is visible. Do you have any solution for this issue?

screen shot 2018-10-18 at 6 45 53 pm
artald commented 6 years ago

There's a solution which is not optimal for all cases. You can add the addBottomView prop on the KeyboardAccessoryView component. It will add a view to fill the gap with a white background color. It's not optimal since there's no support for a custom view or even a custom color.

zcmgyu commented 6 years ago

Thanks for response. I've cheated by add View with position absolute with height: 34 to cover content. Please close this thread. (bow)

renderCoverSafeArea = () => {
    if (isIPhoneX) {
      return <View style={{
    backgroundColor: '#fff',
    height: 34,
    width,
    position: 'absolute',
    bottom: 0,
  }} />;
    }
    return null;
  };