0

How can I disable a UIPicker in xcode? I have tried:

piker.enabled = NO;

and

picker.userInteractionEnabled = NO;

But they just dont seem to work. How could I disable a UIPicker, without removing them from the SubView?

Thanks

Nicholas Gibson
  • 208
  • 2
  • 13

1 Answers1

1

UIPickerView inherits from UIView, which has a "userInteractionEnabled" property, so doing "picker.userInteractionEnabled = NO" should certainly work.

You should make certain that "picker" is a valid IBOutlet and is connected to the actual picker.

Also, to indicate to the user that the picker is disabled, set the alpha of it to some fraction, e.g. "[picker setAlpha: 0.6f];"

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215