UITextField rightViewMode odd behaviour

前端 未结 3 976
夕颜
夕颜 2020-12-30 08:13

I\'m adding a custom clear button (UIButton) to a UITextField as the rightView, however I\'ve found there\'s some weird behaviour on the viewMode. It doesn\'t seem to displa

3条回答
  •  Happy的楠姐
    2020-12-30 08:56

    I recently ran into the same problem and ended up setting right view mode to UITextFieldViewModeAlways and manually showing/hiding that button when it's needed (made proxy delegate which monitored text field state, set button's visibility and passed messages to actual delegate).

提交回复
热议问题