如果我将它更改为 timerView 的子视图,它可以正常工作,但没有其他工作。
timerView = [[UIView alloc] initWithFrame:CGRectMake(0, 278, 105, 33)];
[self.view addSubview:timerView];
UIImageView *changerBackground = [[UIImageView alloc] init];
[changerBackground setImage:[UIImage imageNamed:@"speedbackground.png"]];
changerBackground.frame = CGRectMake(-12 , -16, 105, 33);
[timerView addSubview:changerBackground];
UIButton *normal = [UIButton buttonWithType:UIButtonTypeCustom];
normal.frame = CGRectMake(40, 8, 22, 22);
[normal setBackgroundImage:[UIImage imageNamed:@"normalwhite.png"] forState:UIControlStateNormal];
[normal setBackgroundImage:[UIImage imageNamed:@"normalred.png"] forState:UIControlStateHighlighted];
[normal addTarget:self action:@selector(quickTest:) forControlEvents:UIControlEventTouchUpInside];
[changerBackground addSubview:normal];