How to disable UIPickerView (Objective-C)?

后端 未结 3 1667
长发绾君心
长发绾君心 2020-12-15 18:26

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 <

相关标签:
3条回答
  • 2020-12-15 19:08

    Use this to make it not interactable

    [pickerObj setUserInteractionEnabled:NO];
    

    and this to

    [pickerObj setAlpha:.6];
    

    fade the opacity so it looks non-interactable

    0 讨论(0)
  • 2020-12-15 19:14

    Set the picker's userInteractionEnabled to NO.

    0 讨论(0)
  • 2020-12-15 19:20

    If you are using a UIPickerView associated with a UITextField, just set the text field's isEnabled property to false.

    0 讨论(0)
提交回复
热议问题