iOS hide default keyboard and open custom keyboard

后端 未结 2 711
粉色の甜心
粉色の甜心 2021-01-17 01:22

I have an UITextview, when user taps on UITextview i need to hide the default keyboard. For that i have done,

 [myTextView setEdita         


        
相关标签:
2条回答
  • 2021-01-17 01:43

    You should be using resignFirstResponder instead of setting the UITextView to not editable. This will hide the system keyboard.

     [myTextView resignFirstResponder];
    

    If you want to use a different view for the keyboard then the system provided one then set inputView on the UITextView to the custom view you want to be used in place of the system keyboard.

    myTextView.inputView = myCustomView;
    
    0 讨论(0)
  • 2021-01-17 01:45

    Perhaps using textFieldShouldBeginEditing instead of setEditable: NO works?

    - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
    {
       //Here i have added UIView as subview 
       return NO;
    }
    
    0 讨论(0)
提交回复
热议问题