我正在创建一个UIButton
根据下面提到的代码块编程。我需要将RGB颜色分配给按钮的文本。它不适用。任何特定的原因?UIButton文本颜色与RGB
CGRect buttonFrame = CGRectMake(353, y, 607, 30);
UIButton *button = [[UIButton alloc] initWithFrame: buttonFrame];
button.tag = event.eventId;
[button setTitle:event.eventName forState: UIControlStateNormal];
button.titleLabel.font=[UIFont fontWithName:@"arial" size:14];
[button addTarget:self action:@selector(btnSelected:) forControlEvents:UIControlEventTouchUpInside];
[button setTitleColor:[UIColor colorWithRed:10.0 green:20.0 blue:100.0 alpha:1.0] forState: UIControlEventAllEvents];
[self.contentView addSubview:button];
感谢