0

プログラムでキーボード分割をオフにする方法はありますか。

4

1 に答える 1

1

私の少しの知識では、デフォルトの iPad キーボードのスクロール動作をロックすることはできません。

キーボードの種類などの他の機能を管理したり、カスタムの uikeyboard を作成したりすることもできます。

カスタムuikeyboardの作成について議論しているこの投稿を確認してください

ただし、このコードを見て、目標を達成してみてください

    //The UIWindow that contains the keyboard view - It some situations it will be better to actually
    //iterate through each window to figure out where the keyboard is, but In my applications case
    //I know that the second window has the keyboard so I just reference it directly
    UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];

    //Because we cant get access to the UIKeyboard throught the SDK we will just use UIView. 
    //UIKeyboard is a subclass of UIView anyways
    UIView* keyboard;

    //Iterate though each view inside of the selected Window
    for(int i = 0; i < [tempWindow.subviews count]; i++)
    {
        //Get a reference of the current view 
        keyboard = [tempWindow.subviews objectAtIndex:i];

        //Check to see if the className of the view we have referenced is \"UIKeyboard\" if so then we found
        //the keyboard view that we were looking for
        if([[keyboard className] isEqualToString:@\"UIKeyboard\"] == YES)
        {
            //Keyboard is now a UIView reference to the UIKeyboard we want. From here we can add a subview
            //to th keyboard like a new button

            //Do what ever you want to do to your keyboard here...
        }
    }
于 2013-03-20T18:35:16.817 に答える