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 custom .

Update

Tried to do the following code in viewDidLoad

  [self.button setTitle: @ "default" forState: UIControlStateNormal]; [Self. Button Settital: @ "Selected" forState: UIControlStateSelected]; [Auto button settitle: @ "Highlighted" forState: UIControlStateHighlighted]; [Self chosen from Button Set: Yes];   

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:

  [Set button image: [UIImage imageNamed: @ " some_image "] forState: UIControlState selected | UIControlStateHighlighted];    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -