【发布时间】:2021-11-02 22:56:37
【问题描述】:
这个问题已经讨论过了,但我可以看到仍然没有可用的解决方案。我已阅读有关此事的所有文件。我得到的错误是:“VirtualizedLists 永远不应该嵌套在具有相同方向的普通 ScrollViews 中,因为它会破坏窗口和其他功能 - 请改用另一个 VirtualizedList-backed 容器”在插件的官方文档中,建议应用
import React from 'react';
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';
export const GooglePlacesInput = () => {
return (
<GooglePlacesAutocomplete
placeholder='Search'
onPress={(data, details = null) => {
// 'details' is provided when fetchDetails = true
console.log(data, details);
}}
query={{
key: 'my Key',
language: 'en',
}}
/>
);
};
我想在滚动视图中显示它
export const IznajmiScreen = () => (
<>
<IznajmiListContainer>
<ScrollView keyboardShouldPersistTaps={'handled'} >
<TextInput style={styles.input} placeholder="Naslov" />
<MyDatePickerStart/>
<MyDatePickerEnd/>
<GooglePlacesInput/>
</ScrollView>
</IznajmiListContainer>
</>
)
【问题讨论】:
标签: javascript react-native scrollview googleplacesautocomplete