xon*_*rlz 2 iphone objective-c ipad ios
所以我有以下代码:
UITapGestureRecognizer *showNewsStoryTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showNewsStory:)];
[self.storyImageView_ addGestureRecognizer:showNewsStoryTapGestureRecognizer];
[self.storyTitleLabel_ addGestureRecognizer:showNewsStoryTapGestureRecognizer];
[self.storyImageFailedLabel_ addGestureRecognizer:showNewsStoryTapGestureRecognizer];
[self.storyImageFailedTextView_ addGestureRecognizer:showNewsStoryTapGestureRecognizer];
[showNewsStoryTapGestureRecognizer release];
Run Code Online (Sandbox Code Playgroud)
似乎这只适用于一个UIView,这是最后添加的一个.换句话说UITapGestureRecognizer,它的视图是一对一的关系.它是否正确?我该如何解决?我是否必须UITapGestureRecog为每个人创建一个单独的?