Monotouch Events
本文关键字:Events Monotouch | 更新日期: 2023-09-27 18:13:35
我正在尝试使用MonoTouch运行以下代码:
this.TouchesBegan += delegate { txtAmount.ResignFirstResponder(); };
当我编译时,我得到以下错误:
Cannot assign to `TouchesBegan' because it is a `method group'
API似乎支持这个:http://docs.xamarin.com/ios/advanced_topics/api_design
任何想法?
我猜你用的是UIGestureRecognizer
,对吗?
如果是,那么' TouchesBegan'是一个方法而不是一个事件,所以你不能给它分配委托。
public virtual void TouchesBegan (NSSet touches, UIEvent evt)
你可能想看看:
public UITouchEventArgs ShouldReceiveTouch;
public UIGesturesProbe ShouldRecognizeSimultaneously;
public UIGestureProbe ShouldBegin;
和Touches_GestureRecognizers示例。