Search code examples
iphoneobjective-ciosuiviewuipickerview

How to disable the view while using UIPickerView


I have been using UIPickerView, my question is simple, how to disable the view when picker view is showing, so that we can ensure user are not changing anything in view. I have tried with setuserInteractinEnabled: method but it is disabling picker view too.. Any idea..?


Solution

  • I had to do something similar, and subclassed an UIActionSheet to add a picker view to it. While the Action Sheet is up, you cannot interact with the underlying views.

    You can find some examples here on SO how to add a UIPickerView to an UIActionSheet, like how to add UIPickerView in UIActionSheet