小编niz*_*nti的帖子

如何显示搜索栏的取消按钮?

我想在用户开始在搜索栏上编辑时隐藏我的页面的导航栏,我还想显示一个取消按钮.
已完成,但是当我打开UISearchBar感谢全部时,我的取消按钮无法访问.

- (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar
{
    self.navigationController.navigationBar.hidden=TRUE;
    CGRect r=self.view.frame;
    r.origin.y=-44;
    r.size.height+=44;

    self.view.frame=r;

    searchBar.showsCancelButton=TRUE;

}
Run Code Online (Sandbox Code Playgroud)

iphone uinavigationbar uisearchbar

13
推荐指数
3
解决办法
2万
查看次数

标签 统计

iphone ×1

uinavigationbar ×1

uisearchbar ×1