我正在以编程方式创建一个按钮并将其添加到 UIScrollView:
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(50, 10, 150, 80);
[button setTitle:@"all" forState:0];
button.titleLabel.font = [UIFont fontWithName:@"Helvetica-Light" size:20];
button.titleLabel.textColor = [UIColor blackColor];
button.layer.backgroundColor = [[UIColor clearColor] CGColor];
[scrolView addSubview:newGuysButon];
当我单击滚动视图时,按钮颜色从黑色变为白色。怎么会发生?