如何限制触摸到特定区域或UIView
?如何限制触摸事件到特定区域或UIView?
换句话说,我在视图上有一个UIButton
,但它似乎被触摸禁用。
我还应该写出触摸做我想做的事情,但就像我说的,我失去了控制UIButton
s。
@Implementation
...
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
...
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
...
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
...
}
我解决我的问题......
(我的错误),我做了定位在它之外的UIButtons较小的UIView。子视图被附加到该UIView。 (我可以看到按钮,但我甚至不能按他们)
解决方案(其中2个工作):
- UIButtons的addSubview到self.view
- 或...放大较小的UIView到340 x 480的
你能提供更多的细节吗?你如何处理触摸,你的视图层次是什么? – Vladimir