Sco*_*ser 5 uisearchbar uisearchbardelegate ios ios7
我希望这是一个简单的问题.

我有一个显示取消按钮的搜索栏:
- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar{
[searchBar setShowsCancelButton:YES animated:YES];
}
Run Code Online (Sandbox Code Playgroud)
唯一的问题是取消按钮上的文字没有显示.

按钮显然是因为我可以点击它,但显示按钮时没有文字出现.它好像按钮是不可见的.代码在iOS6中运行良好但现在在iOS7中我遇到了这个问题.有什么想法?我正在使用UISplitViewController,我的搜索栏位于MasterViewController的navigationItem.titleView中.
我不知道它是苹果或预期的错误,但在navigationController中似乎没有显示取消按钮.尝试将搜索栏添加到视图中,然后再将其添加到导航控制器.
UIView *searchBarView = [[UIView alloc] initWithFrame:[searchBar bounds]];
[searchBarView addSubview:searchBar];
self.navigationItem.titleView = searchBarView;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4445 次 |
| 最近记录: |