键盘上的QuickType栏 [英] QuickType Bar on the Keyboard

查看:380
本文介绍了键盘上的QuickType栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家可能都知道键盘上的新Quick Type栏。

As you all might be knowing about the new Quick Type bar on the keyboard.

在我的应用程序中,我在键盘上放了一个自定义TextView栏。但是由于 QuickType Bar ,我的textview被隐藏了。

In my application , I have put a custom TextView bar on the keyboard. But because of QuickType Bar , my textview gets hidden.

我想知道,是否有任何属性或方法可以知道QuickType Bar打开与否?

I want to know , Is there any property or method to know whether the QuickType Bar is open or not ?

推荐答案

- (void)keyboardFrameChanged:(NSNotification*)aNotification
{

    NSDictionary* info = [aNotification userInfo];
    CGPoint from = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].origin;
    CGPoint to = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].origin;


    float height = 0.0f;
    if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
        height = to.x - from.x;
    } else {
        height = to.y - from.y;
    }

    [self setContentSize:CGSizeMake(self.frame.size.width, self.frame.size.height + height)];
}

这篇关于键盘上的QuickType栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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