简体   繁体   中英

how to change keyboard style programmatically in iOS?

I would like to change the keyboard style. I have attached two pictures one the current situation and the second one is the desired situation.

此图像是当前的键盘样式。

这是理想的键盘风格。

try this to change the keyboard type:

self.someTextField.keyboardType = UIKeyboardType.decimalPad

and for number with special character try this :-

UIKeyboardType.numbersAndPunctuation

from :- https://developer.apple.com/documentation/uikit/uitextinputtraits#//apple_ref/c/tdef/UIKeyboardType

well thanks for suggetions and answers .

i found the solution for it.

for the numbers

textField.keyboardType = UIKeyboardType.numbersAndPunctuation

for the alphabets

textField.keyboardType = UIKeyboardType.emailAddress

在此处输入图片说明 - Keyboard Type Suggestions

textField.keyboardType = .emailAddress

After = . (Multiple Suggestions for keyboard type you can select according to your usage)

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