Frage

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

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top