Reputation: 1773
Hopefully someone can help with this, I have a UIPickerView which prompts my user to select a Height and a Weight from the Picker. When selected, it then populates a UILabel with the selected option. Next to each label I want to put a UIImageView which initially starts out displaying a Cross to indicate the required action has not been taken. Then when the user select their values it changes that Image to a tick.
But I cant for the life of me figure out how to go about doing it?
Any advice? Would I place this in the didSelectRow method of the UIPickerView?
Upvotes: 0
Views: 691
Reputation: 8237
UIImageView can be init'ed with two images, normal and highlighted.
(id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage
Select which one you want to be displayed via the highlighted property.
The picker view's delegate function
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
can be the place where you set your label and update the highlighted property of the UIImageView.
Upvotes: 1