Disable particular row value in UIPickerView

前端 未结 1 1802
执念已碎
执念已碎 2020-12-17 00:53

I am trying to disable particular row in pickerView.

I have an array of strings for pickerView. I am appending values in array1 when user selects particular row.

1条回答
  •  天涯浪人
    2020-12-17 01:16

    Option 1: Disabling an element

    You can give the title a greyed out style with the method pickerView:attributedTitleForRow:forComponent:

    Then you can change to a defaut value when that item is selected using pickerView:didSelectRow:inComponent:

    Option 2: Delete the item

    The second option would be to just remove the item from the possible options by adjusting your datasource.

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