基本框架来自https://www.hangge.com/blog/cache/detail_1527.html
这位大神,样式基本没改动,侵权删,
然后在其基础上,添加了淘宝自动补全api
https://suggest.taobao.com/sug?code=utf-8&q=裤
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TextInput,
PixelRatio
} from 'react-native';
import axios from 'axios';
//输入框组件
class AutoSearch extends Component {
//构造函数
constructor(props) {
super(props);
this.state = {
text: '',
show: false,
textlist:[],
};
}
//组件渲染
render() {
return (
<View style={styles.flex}>
<View style={[styles.flexDirection, styles.inputHeight]}>
<View style={styles.flex}>
<TextInput
style={styles.input}
returnKeyType&#