设置UITextfield不能编辑

遵守UITextFieldDelegate 协议,  设置 tf.delegate = self;

然后在该方法中这样做

 

- (void)textFieldDidBeginEditing:(UITextField *)textField {

    UITextField *tf = [self.view viewWithTag:401];

    [tf resignFirstResponder];

}

posted @ 2016-01-26 12:52  YouNeedCourage  阅读(989)  评论(0编辑  收藏  举报