Show UIPickerView text field is selected, then hide after selected

前端 未结 4 887
梦毁少年i
梦毁少年i 2020-12-02 15:11

I am trying to create a text box that when it is selected a UIPickerView opens up with choices to select from. Once selected, the UIPickerView hides and the selected item is

4条回答
  •  情话喂你
    2020-12-02 15:33

    How about in your didSelectRow method you resignFirstResponder?

    func pickerView(pickerView: UIPickerView!, didSelectRow row: Int, inComponent component: Int)
    {
    textfieldBizCat.text = bizCat[row]
    pickerBizCat.resignFirstResponder()
    }
    

提交回复
热议问题