我们无法获得电子邮件,姓名,电话号码建议(自动完成)以在我们的React Native上使用。有人可以帮助您进行故障排除,以了解我们在这里做错了什么吗?
https://facebook.github.io/react-native/docs/textinput#textcontenttype
<Input
placeholder="First Name"
textContentType="givenName"
onChangeText={firstname => (onChange('first_name', firstname))}
value={state.form.first_name}
autoCapitalize="words"
placeholderTextColor={'#262626'}
style={styles.textInput}
/>
它在iOS 13中确实有效。只需使用此处描述的设置,并将其从Swift转换为React Native:
电话号码:
autoCorrect={true}
textContentType="telephoneNumber"
keyboardType="numbers-and-punctuation"
对于电子邮件:
autoCorrect={true}
textContentType="emailAddress"
keyboardType="email-address"
您需要为Android使用其他键盘类型,因此可能类似于:
keyboardType={(Platform.OS === 'IOS') ? "numbers-and-punctuation" : 'phone-pad"}