How to disable keyboard appearing when hitting on a text field , iOS?

后端 未结 8 1525
日久生厌
日久生厌 2021-02-07 19:50

I have a text field , and i need when the user presses it to show a custom picker.

The picker is shown fine , but the problem is that the keyboard appears on the bottom

8条回答
  •  迷失自我
    2021-02-07 20:37

    -(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
    {
        // Here you can do for Specific text Field by 
        if (textField==(the text field you don't want to show keyboard)) {
            NSLog(@"don't show keyboard");
            return NO;
        }
        else {
            return YES;
        }
    }
    

提交回复
热议问题