Question

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

Was it helpful?

Solution

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];"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top