1
我希望能够添加一个特定大小的新UIImageView,它应该有几个UIGestureRecognizers在UIImageView上检测触摸。在运行时使用UIGestureRecognizer创建UIImage
UIImageView的子类是如何实现的?或者最佳实现方式如何?
我希望用户能够在运行时添加UIImageViews,然后gestureRecognizer允许他们操纵视图。
谢谢
我希望能够添加一个特定大小的新UIImageView,它应该有几个UIGestureRecognizers在UIImageView上检测触摸。在运行时使用UIGestureRecognizer创建UIImage
UIImageView的子类是如何实现的?或者最佳实现方式如何?
我希望用户能够在运行时添加UIImageViews,然后gestureRecognizer允许他们操纵视图。
谢谢
我想你只是忘了启用userInteractions。
UIImageView *imageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"foo.png"]] autorelease];
imageView.userInteractionEnabled = YES;
UITapGestureRecognizer *tapGesture = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)] autorelease];
[imageView addGestureRecognizer:tapGesture];
[self.view addSubview:imageView];
我可以得到UIImage上的实际攻丝像素位置吗? – Nil 2015-11-20 11:20:31