点击空白处隐藏键盘
1、点击空白处隐藏键盘及 解决与UItableView点击事件冲突
#region 点击空白处隐藏弹出层
//this.View.UserInteractionEnabled = false;
UITapGestureRecognizer singleTap = new UITapGestureRecognizer(this, new ObjCRuntime.Selector("fingerTapped"));
//解决与UItableView点击事件冲突
singleTap.ShouldReceiveTouch = (recognizer, touch) => touch.View is UITableView;
this.View.AddGestureRecognizer(singleTap);
#endregion
}
[Export("fingerTapped")]
private void fingerTapped()
{
//this.View.EndEditing(true);
this.view_select_bg.Hidden = true;
}
//this.View.UserInteractionEnabled = false;
UITapGestureRecognizer singleTap = new UITapGestureRecognizer(this, new ObjCRuntime.Selector("fingerTapped"));
//解决与UItableView点击事件冲突
singleTap.ShouldReceiveTouch = (recognizer, touch) => touch.View is UITableView;
this.View.AddGestureRecognizer(singleTap);
#endregion
}
[Export("fingerTapped")]
private void fingerTapped()
{
//this.View.EndEditing(true);
this.view_select_bg.Hidden = true;
}
因为一无所有,所以无所畏惧。
不是什么东西,人出生就懂的。
——蚁族的奋斗