Retract the keyboard 1
-(void) Touchesbegan: (Nsset *) touches withevent: (Uievent *) event
{
[Self.view.subviews enumerateobjectsusingblock:^ (id obj, Nsuinteger idx, BOOL *stop) {
[((uiview*) obj) Resignfirstresponder];
}];
}
Retract the keyboard 2
-(void) Resignkeyboardinview: (UIView *) view
{
For (UIView *v in View.subviews)
{
if ([v.subviews count] > 0)
{
[Self resignkeyboardinview:v];
}
if ([V Iskindofclass:[uitextview class]] | | [V Iskindofclass:[uitextfield class]]) {
[v Resignfirstresponder];
}
}
}
Retract keyboard 3--
-(void) touchesended: (Nsset *) touches withevent: (Uievent *) event
{
For (uiview* view in self.view.subviews) {
if ([View Iskindofclass:[uitextfield class]])
[View Resignfirstresponder];
}
}
Retract keyboard 4---applicable scrollview
Premise: View inherits Uicontorl, Connection touch down
Touch down--action
-(Ibaction) Backgroundtap: (ID) sender
{
[phonenumbertextfiled resignfirstresponder];//notification text loses first responder status keyboard retract
}