How do you keep the cancel button in the search bar enabled when the keyboard is dismissed?

前端 未结 11 1776
萌比男神i
萌比男神i 2020-12-30 01:23

\"enter \"enter

11条回答
  •  梦毁少年i
    2020-12-30 02:10

    For Swift 4.0

    if let cancelButton : UIButton = searchBar.value(forKey: "cancelButton") as? UIButton{
        cancelButton.isEnabled = true
    }
    

提交回复
热议问题