ios - Change image of UIButton on select or unselect -


I can select some fields to click on UIButton in my iOS app user.

I want to be able to open my MMPickerView by changing the button's button when the user selects the field on the click of the UIButton and when the user again UIButton should be unchecked and the previous image should be displayed in the UIButton and do not open MMPickerview at this time.

This is my code:

  - (IBAction) showPickerViewButtonPressed: (ID) Sender {if ((_button.selected =! _button.selected)} {UIImage * bimage = [UIImage imageNamed: @ "play.jpg"]; [_button setImage: bimage forState: UIControlStateNormal]; } {{MMPickerView showPickerViewInView: self.view withStrings: _stringsArray withOptions: @ {MMbackgroundColor: [UIColor blackColor], MMtextColor: [UIColor whiteColor], MMtoolbarColor: [UIColor blackColor], MMbuttonColor: [UIColor whiteColor], MMfont: [UIFont systemFontOfSize : 18], MMvalueY: @ 3, MMselectedObject: _selectedString} Closing: ^ (NSString * selectedString) {_label.text = selectedString; _selectedString = selectedString; }]; }}    

UIImage * bimage = [UIImage imageNamed: @ "play_select JPG "]; [_button setImage: bimage forState: UIControlStateSelected]; [_button setImage: bimage forState: UIControlStateHighlighted];

where the button is announced

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -