문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top