未在本机反应中选择自动建议

问题描述

大家希望你们一切顺利。 我在我的 react-native 项目中添加了带有 expo 的 react-native-google-places-autocomplete。当我搜索任何地址时,时间下拉列表将显示但我没有得到选择自动完成地址。 如果有人遇到这个问题,请告诉我。 提前致谢。 这是我下面给出的代码

 <View style={{flex:1,borderWidth: 1,borderRadius: 5,borderColor: 'gray',width: this.state.orientation == 3 || this.state.orientation == 4 ? widthPercentagetoDP('94%') : widthPercentagetoDP('94%'),paddingLeft: widthPercentagetoDP('3%'),left: widthPercentagetoDP('0%'),fontSize: this.state.orientation == 3 || this.state.orientation == 4 ? heightPercentagetoDP('3.8%') : widthPercentagetoDP('3.8%'),top: heightPercentagetoDP('2%'),flexDirection: 'row',justifyContent: 'space-between' }}>
                <GooglePlacesAutocomplete
                  placeholder='Search By City...'
                  value={this.state.value}
                  keyboardShouldPersistTaps={'handled'}
                  listUnderlayColor={'transparent'}
                  textInputProps={{
                    onChangeText: (value) => this.onChangeText(value),clearButtonMode: 'never',height:this.state.orientation == 3 || this.state.orientation == 4 ? heightPercentagetoDP('7%') : this.state.orientation == 1 ? heightPercentagetoDP('7%') : heightPercentagetoDP('6.5%'),top:this.state.orientation == 3 || this.state.orientation == 4 ? heightPercentagetoDP('0.3%') : this.state.orientation == 1 ? heightPercentagetoDP('0.3%') : heightPercentagetoDP('0%'),}}
                  minLength={1}
                  returnKeyType={'search'}
                  listViewdisplayed={'auto'}
                  fetchDetails={true}
                  onSubmitEditing={() => this.searchByZipCode()}
                  getDefaultValue={() => ''}
                  query={{
                    key: 'yourkeyhere',language: 'en'
                  }}
                  nearbyPlacesAPI='GooglePlacesSearch'
                  debounce={200}
                  listViewdisplayed={false}
                  // enablePoweredByContainer={false}
                  onFail={(error) => console.log(error)}
                  // onFail={(error) => alert(error)}
                />
              </View>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)