ios - Change backgroundcolor for UIButton IPhone -


I have a problem I use a button as BarButtonItem Works, but my background works only when I click on my button. How can I make it so that my background color will be set every time?

  UIButton * redEmergencyButton = [[Maintaining UIButtonTypeRoundedRect] with UIButton Button;]; RedEmergencyButton.frame = CGRectMake (100, 100, 100, 50); RedEmergencyButton.backgroundColor = [UIColor colorWithRed: 0.8Hara: 0.898039215686274509803 Blue: 1.0 alpha: 1.0]; [RedEmergencyButton setTitle: @ "Emergency" forState: UIControlStateNormal]; [RedEmergencyButton addTarget: Self-Proceeding: @Selector (Dormancy) for Control Events: UIControlEventTouchUpInside]; UIBarButtonItem * rButton = [[UIBarButtonItem alloc] initWithCustomView: redEmergencyButton];    

You setTintColor for UIBarButtonItem :


Comments