0
我編程方式創建一個按鈕,將其添加到UIScrollView中:本身的UIButton顏色變化
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];
當我點擊滾動視圖,按鈕顏色從黑到白的。怎麼會發生?
謝謝,它有幫助! – Sergey