Hiding Cancel button on search bar in UISearchController

前端 未结 6 874
离开以前
离开以前 2020-12-07 02:08

I\'m trying to hide the Cancel button of the search bar in the UISearchController, but unfortunately setting the following in viewDidLoad() does not work:

ov         


        
6条回答
  •  日久生厌
    2020-12-07 02:47

    Rejoice! As of iOS 13, there is access to automaticallyShowsCancelButton on UISearchController. Set it to false to hide the cancel button.

提交回复
热议问题