作者:mobiledu2502914555 | 来源:互联网 | 2023-06-08 10:51
1234567891011- (void)viewDidLoad { [super viewDidLoad]; UIView *view = [[UIView alloc] ini
1 2 3 4 5 6 7 8 9 10 11
| - (void)viewDidLoad {
[super viewDidLoad];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
view.backgroundColor = [UIColor redColor];
[self.view addSubview:view];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSLog(@"你点到我了");
} |
我本来后续打算增加UITapGestureRecognizer给我的view整个点击事件,没想到父视图的touchesBegan方法被响应了。
我不想让我的view也响应touchesBegan这个方法,改如何解决呢?