如何阻止我的自定义键盘“浮动”或在iPad上取消停靠 [英] How to stop my Custom Keyboard from 'floating' or being undocked on iPad

查看:307
本文介绍了如何阻止我的自定义键盘“浮动”或在iPad上取消停靠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将textField的inputView设置为我的KeyboardView时,我有一个自定义键盘,可以显示某个UITextField。键盘效果非常好,但很明显,如果用户之前已取消内置的Apple键盘或将其拆分,键盘将浮动。

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.

我有搜索了几个小时的方法,以确保我的自定义键盘不像这样,而是停留在屏幕的底部,无论用户是否先前已取消内置的Apple键盘。

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];


推荐答案

你不应该这样做,也不应该这样做这样做的方法。



您无法使用自定义键盘覆盖用户设置,尤其是不能改善用户界面可访问性的键盘。

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.

这篇关于如何阻止我的自定义键盘“浮动”或在iPad上取消停靠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆