To disable editing in UITextField you need to return NO
in delegate method textFieldShouldBeginEditing:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{
return NO;
}
To disable editing in UITextView set property editable
to NO
:
[textView setEditable:NO];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…