隐藏UISearchBar的清除按钮

 

//隐藏UISearchBar的清除按钮

    UITextField *searchField;

    for (UIView *subview in [_searchBar.subviews firstObject].subviews)

    {

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

            searchField = (UITextField *)subview;

            searchField.clearButtonMode = UITextFieldViewModeNever;

            break;

        }

    }

 

posted @ 2016-05-17 14:18  YouNeedCourage  阅读(1142)  评论(0编辑  收藏  举报