Answers
如果代码中有UITextField/UITextView,需要继承UITextField的代理方法UITextFieldDelegate/UITextViewDelegate
@interface viewcontroller : UIViewController<UITextViewDelegate,UITextFieldDelegate>
针对与点击btn,弹出键盘
UITextField *test = [UITextField new] ;
test.delegate = self;
- (void)btnClick
{
[test becomeFirstResponder];//弹出键盘
//取消键盘 [test resignFirstResponder]
}
天然星☆↗
answered 9 years, 7 months ago