0
TableView中頁腳我有一個按鈕titleLabel.textColor爲UIButton的
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
UIView *mainView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 39)];
[mainView setBackgroundColor:[UIColor clearColor]];
UIButton *themebutton= [UIButton buttonWithType:UIButtonTypeCustom];
themebutton.backgroundColor= [UIColor redColor];
[themebutton.layer setCornerRadius:5.8f];
themebutton.frame= CGRectMake(15, 0, 172, 39);
[themebutton setTitle:@"Create New" forState:UIControlStateNormal];
[themebutton setTitle:@"Create New" forState:UIControlStateSelected];
[themebutton setTitle:@"Create New" forState:UIControlStateHighlighted];
themebutton.titleLabel.font=[UIFont fontWithName:@"Raleway" size:19.8];
themebutton.titleLabel.textColor=UIColorFromRGB(0x707070);
[mainView addSubview:themebutton];
return mainView;
}
我已經把titleLabel.textColor爲灰色,但是當我點擊該按鈕,它總是文字的顏色轉換成白光。爲什麼這種情況會有人幫助我。