How to stop my Custom Keyboard from 'floating' or being undocked on iPad

↘锁芯ラ 提交于 2019-12-06 17:27:32

问题


I have a custom Keyboard that gets displayed for a certain UITextField when I set the textField's inputView to my KeyboardView. The keyboard works fantastically well but it has become apparent that the keyboard will 'float' if the user has previously undocked the built in Apple Keyboard or indeed split it.

I have searched for many hours for a way to ensure my custom keyboard does not act like this and instead stays docked to the bottom of the screen regardless as to whether the user has previously undocked the built in Apple Keyboard.

self.keyboardInputView = [[[KeyboardInputViewController_iPad alloc]
                            initWithNibName:@"KeyboardInputViewController_iPad"
                            bundle:[NSBundle mainBundle]] autorelease];
self.keyboardInputView.delegate = self;                
self.keyboardInputView.keyboardTextField = myTextField;
myTextField.inputView = self.keyboardInputView.view;
[myTextField becomeFirstResponder];

回答1:


You shouldn't do this, neither is there a way to do so.

You cannot override user settings with a custom keyboard, especially not the ones that can improve the accessiblity of a user interface.

You could include a warning in the tutorial that your keyboard works best while being locked to the bottom, but you must ask yourself the question whether this is good UX or not. I would say the latter.



来源:https://stackoverflow.com/questions/12837275/how-to-stop-my-custom-keyboard-from-floating-or-being-undocked-on-ipad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!