Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable UIPickerView (Objective-C)?

Tags:

Is there a way to make the UIPickerView read-only? This means that the user cannot flip through the options.

PS. This is not the same as not passing anything in the didSelectRow method because I only want the user to see that the picker is there and not to touch it.

like image 916
erastusnjuki Avatar asked Mar 04 '10 08:03

erastusnjuki


2 Answers

Set the picker's userInteractionEnabled to NO.

like image 192
kennytm Avatar answered Sep 19 '22 15:09

kennytm


Use this to make it not interactable

[pickerObj setUserInteractionEnabled:NO];

and this to

[pickerObj setAlpha:.6];

fade the opacity so it looks non-interactable

like image 40
hcwiley Avatar answered Sep 19 '22 15:09

hcwiley