是否可以在视图中实现手势识别器并将其传播到所有其他 UI 组件?如果我做这样的事情,它不起作用:
UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(SwipeRecognizer:)];
swipe.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:swipe];
[TitleLabel addGestureRecognizer:swipe];
[DescLabel addGestureRecognizer:swipe];
[_TopView addGestureRecognizer:swipe];
[_BottomView addGestureRecognizer:swipe];
[_ScrollView addGestureRecognizer:swipe];
[_TableView addGestureRecognizer:swipe];
[swipe release];
我该怎么做?
我需要在我的视图上添加一个透明视图,覆盖所有对象?或者有一种智能的方法可以做到这一点?