隐藏UISearchBar中的删除按钮

 

UISearchBar *searchBar;

 

for (UIView *subview in [searchBar.subviews firstObject].subviews{

  if ([subview isKindOfClass:[UITextField class]]) {

    UITextField *searchField = (UITextField *)subview;

    searchField.clearButtonMode = UITextFieldViewModeNever;

    break;

  }

}

posted on 2017-05-23 18:26  Zerone-  阅读(252)  评论(0)    收藏  举报

导航