I am currently using the following method to stop the cancel button item from showing up in the search bar. I have a custom UIButton that I would like to use in
UIButton
for (UIView *possibleButton in searchBar.subviews) { if ([possibleButton isKindOfClass:[UIButton class]]) { UIButton *cancelButton = (UIButton*)possibleButton; cancelButton.enabled = YES; break; } }
one go through this link UISearchBar disable auto disable of cancel button