Reputation: 5970
In my iPad app I have a UIButton that when pressed initiates some data transfer which takes time. During this time the button turns blue as shown:
Is there anyway of changing this colour?
Upvotes: 1
Views: 217
Reputation: 27345
Change the tint color, it will be used when button is highlighted.
[myButton setTintColor:[UIColor blackColor]];
Upvotes: 3
Reputation: 3656
Try This
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(10, 50, 100, 50)];
[button setTitle:@"hi" forState:UIControlStateNormal];
[button setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:button];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:5.0];
button.backgroundColor = [UIColor whiteColor];
[UIView commitAnimations];
Upvotes: 0