ios - UIButton changes states when being pressed -
I have a UIButton that is configured with two states, default and selected for different text and background Builder is set up on the set-up interface. The strange thing is that when the button is in the selected state, and the button is pressed, it automatically turns to the default state. After the button is released, it turns back to the selected state. Is there a way to disable roll-to-to-default behavior?
forgot to mention it, type is Tried to do the following code in viewDidLoad Shows buttons on pressing. The selected state and the highlighted state are not mutually exclusive when you press any selective UI button, So it gets in a selected and highlighted position. I do not think there is a way to set up in IB, but you can do it in code: custom .
Update
[self.button setTitle: @ "default" forState: UIControlStateNormal]; [Self. Button Settital: @ "Selected" forState: UIControlStateSelected]; [Auto button settitle: @ "Highlighted" forState: UIControlStateHighlighted]; [Self chosen from Button Set: Yes];
[Set button image: [UIImage imageNamed: @ " some_image "] forState: UIControlState selected | UIControlStateHighlighted];
Comments
Post a Comment