Hiding/ Showing UIPickerView

后端 未结 8 596
广开言路
广开言路 2020-12-05 11:09

I Have an a touchesEnded event that checks for when a UITextField is pressed. What I would like it to do is is hide/show a UIPickerView. How can this be done?



        
8条回答
  •  时光说笑
    2020-12-05 11:32

    UIPickerView inherits from UIView, so you should be able to just toggle its 'hidden' property:

    if (pickerView) pickerView.hidden = !pickerView.hidden;
    

提交回复
热议问题