[英]My Imageview on top of uiview is not responding to touch events
viewImageView=[[UIImageView alloc] initWithImage:viewImage];
viewImageView.center=self.center;
[[self superview] addSubview:viewImageView];
我已經將imageview添加到superview.self
是UIView
子類。 但是,當我點擊或從右向左滾動時,會touchesbegin: withEvent:
和touchesEnded:withEvent:
但是,當我點擊或從左向右移動時touchesEnded:withEvent:
不會被調用。 touchesCancelled:withEvent:
正在調用touchesCancelled:withEvent:
請幫助我解決此問題。
代替
[[self superview] addSubview:viewImageView];
嘗試這個:
[[self view] addSubview:viewImageView];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.