我使用带有“setInputView”功能的自定义键盘实现了文本字段。
但我有一个问题:我的键盘框架不是标准的 iphone 键盘框架。
问题是:
如何更改自定义键盘的大小?
我知道一些功能,例如:UIKeyboardFrameBeginUserInfoKey,.. 等。
请注意:
iPhone 键盘框架是 = 0,264,320,216
我的自定义键盘框架是 = 0,0,320,460
期待您的友好合作,
此致...
磷
最佳答案
事实证明,您分配给 UITextField
的自定义输入 View 的默认行为的属性是将 View 大小调整为与默认键盘相同的框架。尝试设置(我使用名称 InputViewController
作为我的输入 View ,但你可以使用任何你想要的):
inputViewController = [[InputViewController alloc] initWithNibName:@"InputViewController" bundle:nil];
inputViewController.delegate = self;
inputViewController.view.autoresizingMask = UIViewAutoresizingNone; // This is the code that will make sure the view does not get resized to the keyboards frame.
更多详细信息可以查看this link ,由 提供苹果 .:
If UIKit encounters an input view with an UIViewAutoresizingFlexibleHeight value in its autoresizing mask, it changes the height to match the keyboard.
希望有帮助!
关于textfield - 自定义键盘 : inputView: how to change the Keyboard size?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6042060/