문제

I have a UITextView that is being edited and I want to add a custom keyboard... is there any way to dismiss the keyboard but leave the textView in edit mode so the blue cursor keeps flashing? Or better yet is there any way to put a view ontop of the keyboard?

도움이 되었습니까?

해결책 2

try this

uitextfieldView.inputView = [[UIView new] autorelease];

the system keyboard view not shows and it keeps the cursor as you editing.

or you can hide keyboard by sliding it off-screen

frame.origin.y = (keyboard.frame.origin.y - 264);
keyboard.frame = frame;

다른 팁

You should register for notification UIKeyboardWillShowNotification. It will hit the registered function before displaying keyboard.

Here you can iterate through all Windows and can identify keyboard by below way:

for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows]) 
{
    for (UIView *keyboard in [keyboardWindow subviews]) 
    {
        if([[keyboard description] hasPrefix:@"<UIKeyboard"] == YES
           ||[[keyboard description] hasPrefix:@"<UIPeripheralHost"]== YES) 

        {
                  //Set proper frame to hide key board here..
       }

}

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top