我有一个标签在上面的按钮。标签阻止按钮,所以我不能点击它。标签封锁按钮点击
timerView = [[UIView alloc] initWithFrame:CGRectMake(0, 278, 105, 27)];
[self.view addSubview:timerView];
UIButton *timerBackground = [UIButton buttonWithType:UIButtonTypeCustom];
[timerBackground setBackgroundImage:[UIImage imageNamed:@"Time Background.png"] forState:UIControlStateNormal];
[timerBackground setBackgroundImage:[UIImage imageNamed:@"Time Background.png"] forState:UIControlStateHighlighted];
[timerBackground addTarget:self action:@selector(openTimeChanger) forControlEvents:UIControlEventTouchUpInside];
timerBackground.frame = CGRectMake(-2 , 15, 102, 27);
[timerView addSubview:timerBackground];
DateDay = [[UILabel alloc] initWithFrame:CGRectMake(6, 4, 20, 21)];
DateDay.backgroundColor = [UIColor clearColor];
DateDay.textColor = [UIColor whiteColor];
[timerBackground addSubview:DateDay];
我希望标签是'透明'的点击,所以我可以点击按钮。