iOS 7 doesn't show cancel button of search bar in navigation bar

后端 未结 8 1230
情书的邮戳
情书的邮戳 2021-02-04 02:47

In an app that\'s supposed to run on iOS 6 and iOS 7, the cancel button of the search bar embedded in the navigation bar is not shown anymore if the app is run on iOS 7. On iOS

8条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-04 03:16

    There are two options:

    1. Add a search bar like a subview to uiviewcontroller.view and hide a navigation bar if needs
    2. Add a cancel button to uiviewcontroller.navigationItem.rightBarButtonItem

    my preference is the second one, but it looks more native with the first one.

提交回复
热议问题