How to disable UITextField editing but still accept touch?

后端 未结 15 2348
误落风尘
误落风尘 2020-11-29 19:55

I\'m making a UITextField that has a UIPickerView as inputView. Its all good, except that I can edit by copy, paste, cut and select te

15条回答
  •  旧时难觅i
    2020-11-29 20:20

    Simply place a UIButton exactly over the entire UITextField with no Label-text which makes it "invisible". This button can receive and delegate touches instead of the Textfield and the content of the TextField is still visible.

提交回复
热议问题