How can I change strings of “Cancel” button, “No Results” label in UISearchBar of UISearchDisplayController?

前端 未结 4 1195
借酒劲吻你
借酒劲吻你 2020-12-02 18:05

How can I change strings of \"Cancel\" button, \"No Results\" label in UISearchBar of UISearchDisplayController?

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 18:28

    A simpler solution for changing the Cancel button text:

    [self.searchDisplayController.searchBar setValue:@"custom text" forKey:@"cancelButtonText"];
    

    Tested in iOS 10

提交回复
热议问题