Ios 我使用xib在自定义键盘中加载inputView。我想知道当方向改变时如何改变inputView的高度?

Ios 我使用xib在自定义键盘中加载inputView。我想知道当方向改变时如何改变inputView的高度?,ios,objective-c,iphone,custom-keyboard,Ios,Objective C,Iphone,Custom Keyboard,我一直在开发带有扩展的自定义键盘。我想在设备旋转时更改键盘的高度。目前我不使用大小类,只使用自动布局约束。当您将设备旋转(例如,从纵向向右旋转到横向,从Landscap向右旋转到纵向)时,请提前感谢 -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { if (fromInterfaceOrientation == UIInterfaceOrientation

我一直在开发带有扩展的自定义键盘。我想在设备旋转时更改键盘的高度。目前我不使用大小类,只使用自动布局约束。当您将设备旋转(例如,从纵向向右旋转到横向,从Landscap向右旋转到纵向)时,请提前感谢

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    if (fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
    {
        // change you height constraints here when landscap;
    }
    else if (fromInterfaceOrientation == UIInterfaceOrientationMaskPortrait)
    {
        // change you height constraints here when portrait;
    }
}

你给键盘视图设置了高度限制了吗?是的,我试着给inputView添加高度限制,但它不起作用。你能告诉我什么时候改变约束的常数吗。我的意思是在哪个回调中?你知道如何以编程方式更改约束高度吗?是的,我知道以编程方式更改约束高度