React-native: How to control what keyboard pushes up

后端 未结 3 1024
眼角桃花
眼角桃花 2020-12-08 06:26

The structure of the app is fairly simple: A searchbar, a listview and react-native-tabs at the bottom. The problem: If I click on the searchbar on Android it pushes the who

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 07:10

    For those using Expo

    @J KW's answer is correct but if you're using Expo you will have to implement it differently.

    Expo uses different configuration terms. In your app.json you have to set the configuration key "softwareKeyboardLayoutMode":"pan" in your android object. Your file might look something like:

    {
      "expo": {
        "name": "App",
        ...
        "android":{"softwareKeyboardLayoutMode": "pan"},
        ...
      }
    }
    

    Note: If you are receiving a "should NOT have additional property" error, it's likely because you don't have the updated Expo SDK (v.038). Please update your Expo version.

    Documentation: https://docs.expo.io/workflow/configuration/

提交回复
热议问题