ios - Change image of UIButton on select or unselect -
I can select some fields to click on I want to be able to open my This is my code: where the button is announced UIButton in my iOS app user.
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.
- (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];
Comments
Post a Comment