UISearchController searchBar showsCancelButton not being respected

后端 未结 12 2355
北荒
北荒 2021-02-13 03:58

I\'ve added a UISearchController to my application and set it\'s searchBar to the titleView of my navigationItem.

This works but I am seeing t

12条回答
  •  Happy的楠姐
    2021-02-13 04:31

    This appears to be a bug in iOS. The same behavior I've described can be seen in the example project supplied by Apple

    https://developer.apple.com/library/ios/samplecode/TableSearch_UISearchController/Introduction/Intro.html

    The documentation states that the default for this is NO but this doesn't seem to be the case. Setting showsCancelButton to NO seems to have no effect.

    I have filed a radar for this and am waiting to hear back.

提交回复
热议问题