我们的申请中遇到了一个令人讨厌的问题。我们使用UIWebView
作为某些卡支付资料(3Dsecure)并遇到了UIKeyboard
的问题。
点击网页的输入字段时,它会获得焦点,您可以看到光标,但键盘不会出现:
Input field has cursor, but no keyboard on the screen
但实际上你可以按下按钮并输入作品:
You can touch keyboard buttons
另一个奇怪的行为是关于通知。如果我将观察者添加到UIKeyboardWillShowNotification
,UIKeyboardDidChangeFrameNotification
和UIKeyboardDidShowNotification
,则只会调用willShow方法。通知数据也与UITextField
的键盘通知不同。
的UITextField :
{name = UIKeyboardWillShowNotification; userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.35";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";}}
网页输入字段
{name = UIKeyboardWillShowNotification; userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 260}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 698}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 438}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 260}}";
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 308}, {320, 260}}";}}
已经尝试过任何与半身相关的UIWebView-keyboard
修正案,例如[window makeKeyAndVisible]
。没运气。经常在模拟器和设备上重现(iPhone5 iOS8.4,模拟器iPhone5 iOS8.3)。
还有一件事:离开此屏幕后,调用原生UITextField
的键盘也会被破坏 - 它们出现(没有动画),您可以输入一些字母。但是当你完成键盘停留在屏幕上并将触摸传递到视图时。
有什么想法吗?真的很感激对此的一些想法!提前谢谢!