iOS7 when UIsearchbar added in UINavigationBar not showing cancel button

前端 未结 7 890
误落风尘
误落风尘 2020-12-03 01:33

I add UISearchBar above UINavigationBar and set UIsearchbar showsCancelButton YES, work fine in iOS6 but in iOS7 not showing cancel button. I used below code snippet

7条回答
  •  既然无缘
    2020-12-03 01:58

    Yes In iOS 7 button is located on the screen, but it's title could be invisible My solution was to set Search Style to "Minimal" and choose bar tint colour for "Cancel" text colour in IB

    enter image description here

    And the Result in a simulator :

    enter image description here

提交回复
热议问题