簡體   English   中英

React Native:如何在 TextInput 字段中顯示 email 自動完成

[英]React Native: How to show email autocompletion in TextInput field

當用戶在 TextInput 中輸入 email 地址時,Expo / React Native 是否有可能自動完成 email?

例如,當我使用手機上的應用程序並輸入john@時,我的鍵盤會給我建議 gmail.com、outlook.com 和 yahoo.com。

我要的結果截圖

我一直試圖讓它在我的 iOS 模擬器和 Android 模擬器上運行,但無法得到這個結果。

Expo: 46.0.7React Native: 0.69.6

這些是我的TextInput字段的屬性

<TextInput
  onChangeText={handleEmailChange}
  editable={true}
  placeholder={'Enter a value...'}
  keyboardType="email-address"
  textContentType='emailAddress'
  returnKeyType="done"
  returnKeyLabel="done"
  autoCapitalize="none"
  autoComplete="email"
  ref={emailRef}
  blueOnSubmit={Platform.OS === "ios" ? true : false}
 />

嘗試傳遞inputmode='email' https://reactnative.dev/docs/textinput#inputmode

如果這不起作用,請嘗試使用 iOS: https://stackoverflow.com/a/56017919/10657559

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM