[英]How can I check does my ios8 custom keyboard extension have open access?
[英]How can I add a Number and Decimal keyboard into my Custom Keyboard on iOS8?
我在Swift中创建了一个自定义键盘,但由于“键盘扩展不包含数字和小数类型”而被App Store拒绝。
如何轻松添加这两个键盘?
我试图重建原始视图,但无法正常工作。 我确定有解决方案可以创建2个或3个不同的视图并在它们之间切换。
键盘类型更改时如何在键盘类型之间切换?
您可以在textDidChange
检测对键盘类型的textDidChange
。 您需要获取UITextDocumentProxy
然后检测代理的keyboardType
,然后可以进行所需的任何布局更改。
override func textDidChange(_ textInput: UITextInput?) {
// Called when the document context is changed - theme or keyboard type changes
let proxy = self.textDocumentProxy as UITextDocumentProxy
if proxy.keyboardType == UIKeyboardType.numberPad
|| proxy.keyboardType == UIKeyboardType.decimalPad {
//add code here to display number/decimal input keyboard
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.