UISearchBar中更改UITextField的clearButtonMode


for (UIView* view in mySearchbar.subviews)
    {
        for (UIView *v in view.subviews) {
            if ( [v isKindOfClass: [UITextField class]] )
            {
                UITextField *tf = (UITextField *)v;
                tf.clearButtonMode = UITextFieldViewModeNever;
            }
        }
    }

你可能感兴趣的:(UISearchBar中更改UITextField的clearButtonMode)