- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
在 iOS8 设备或 iOS8 模拟器上:
我有一个成为第一响应者的 UITextView。一切正常,直到应用退出事件状态(通过按下主页键)。
应用程序再次激活后,键盘的外观发生了变化 - 参见图片
键盘确实有一个 keyboardAccessoryView,出于客户隐私考虑,我已将其从图像中移除。但是,如果删除 keyboardAccessoryView,则不会发生不良行为。
到目前为止,我唯一的解决方案是在 UIApplicationWillResignActiveNotification 上 resignFirstResponder 并在 UIApplicationDidBecomeActiveNotification 上成为 FirstResponder。
有没有其他人看到这个问题并[希望]修复它?
为了完整起见,这里是应用程序进入 Springboard 之前的键盘屏幕截图
最佳答案
目前最好的缓解措施如下 -
添加通知处理程序以在应用程序变为事件/ react 时捕获
[[NSNotificationCenter defaultCenter]addObserver:self
selector:@selector(activateKeyboard)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self
selector:@selector(deactivateKeyboard)
name:UIApplicationWillResignActiveNotification
object:nil];
然后找到this之后所以答案有点旧,我试图让 becomeFirstResponder 尽快发生。
- (void)activateKeyboard;
{
[UIView animateWithDuration:0.0f
animations:^{
[self.textView becomeFirstResponder];
}];
}
- (void)deactivateKeyboard;
{
[self.textView resignFirstResponder];
}
关于ios - 带有 keyboardAccessoryView 的 UITextView Keyboard 在 Springboard 之后变为蓝色(倒置),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25992113/
在 iOS8 设备或 iOS8 模拟器上: 我有一个成为第一响应者的 UITextView。一切正常,直到应用退出事件状态(通过按下主页键)。 应用程序再次激活后,键盘的外观发生了变化 - 参见图片
我是一名优秀的程序员,十分优秀!