我有一個標籤在上面的按鈕。標籤阻止按鈕,所以我不能點擊它。標籤封鎖按鈕點擊
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];
我希望標籤是'透明'的點擊,所以我可以點擊按鈕。