我创建了一个自定义文本输入视图,并试图强制键盘在键盘上显示所有大写;类似于UITextField
. 这是我尝试过的,但对我不起作用:
class CustomInput: UIView, UIKeyInput {
// UIKeyInput inherits this property
var autocapitalizationType: UITextAutocapitalizationType {
get { return .AllCharacters }
set { }
}
}
我希望覆盖变量并且只允许.AllCharacters
会强制键盘全部大写,但事实并非如此。有什么想法可以让键盘全部大写吗?