2010-04-16 75 views
0

我想用一个文本框和按钮来使用UIview和UIImage的ontop,我希望用户在UIview或视图中的任何内容被触摸时拖动它,那么实现此方法的最佳方式是什么?如何使用UIimage ontop检测UIView上的触摸?

UIView在单个视图控制器上,并使用界面生成器来制作我的UIviews和UIimages。

回答

0

您需要继承UIView和实施

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event,并

- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event