我在做反应-地点-自动完成的反应本土,我想要一种风格,像Textinput.
这是我想要的像第一个是GooglePlacesAutocomplete,第二个是TextInput这样的结果的图像
`
const App = () => {
return (
<View>
<GooglePlacesAutocomplete
placeholder='Search'
fetchDetails={true}
onPress={(data, details) => {
// console.log('data: ', data);
console.log('details: ', details);
alert(details.formatted_address)
}}
query={{
key: '',
language: 'en',
}}
/>
<Text>{'\n'}</Text>
<Text>{'\n'}</Text>
<Text>{'\n'}</Text>
<TextInput
placeholder='Search here....'
style={{width:350,height:40,borderBottomColor:'black',borderBottomWidth:1,paddingLeft:10,fontSize:20}}
/>
</View>
);
};
export default App;`
How I Can get output like image??发布于 2022-11-29 13:51:34
您可以使用这样的格式并自定义输入。
<GooglePlacesAutocomplete
placeholder="Search location....."
minLength={1}
fetchDetails={true}
styles={{
listView: {},
textInputContainer: {},
textInput: {},
}}
debounce={300}
/>您可以根据需要在textInput中添加样式。
https://stackoverflow.com/questions/74614926
复制相似问题