簡體   English   中英

我使用xib在我的自定義鍵盤中加載inputView。 我想知道當方向改變時如何改變inputView的高度嗎?

[英]I used xib to load the inputView in my custom keyboard. I Would like to know how to change height of inputView when orientation changes?

我一直在開發帶有擴展名的自定義鍵盤。 我想在設備旋轉時更改鍵盤的高度。 當前不使用大小類,而僅使用自動布局約束。 提前致謝

旋轉設備時,例如,將肖像縱向旋轉為橫向,將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;
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM