一咽筋、取消第一響應(yīng)。(可以在增加的手勢中徊件,touchesBegan中)
UITapGestureRecognizer*tap=[[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(tap:)];[self.viewaddGestureRecognizer:tap];
-(void)tap:(UITapGestureRecognizer*)sender
{
UITextField*textfield=(UITextField*)sender.view;
[textfieldresignFirstResponder];
[onetextresignFirstResponder];
[twotextresignFirstResponder];
[textviewresignFirstResponder];
}
二奸攻、self.view endEditing結(jié)束編輯模式。(在增加的手勢虱痕,touchesBegan中)
-(void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
[self.viewendEditing:YES];
//[onetext resignFirstResponder];
//[twotext resignFirstResponder];
//[textview resignFirstResponder];
}
三睹耐、點擊鍵盤return鍵收起鍵盤。
- (BOOL)textFieldShouldReturn:(UITextField*)textField
{
[textFieldresignFirstResponder];
returnYES;
}
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者