简体   繁体   中英

Update keyboard prediction bar suggestions swift

I have a sign up screen which has 4 textfields, First name, last name, email & password.

Apple keyboard prediction for password works fine but for others

First Name textfield shows "Full Name" in prediction Last Name shows "Full Name" email textfield shows "Password" key on right.

How can i update this to show First Name textfield's prediction will show "FirstName" instead of "FirstName lastName" same with last Name textfield and for email textfield it should show "emailaddress@,," in prediction

this is not a custom keyboard UILexicon doesn't work

You should set the textContentType property of your fields to the appropriate value in order to let iOS know the suggestions it should provide:

eg

 myGivenNameField.textContentType = UITextContentType.givenName
 mySurnameField.textContentType = UITextContentType.familyName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM