views:

303

answers:

0

I have managed to resize the Textfield of the UISearchBar thanks to this question: Changing the size of the UISearchBar TextField according to the subclassing approach of timmytheRock.

The problem is, when the user selected the textfield, I would like to have the cancel button correctly added (i.e. animated and in the right position). Right now, the cancel button shows up not animated in the top left corner. I guess it's because there is no designated space for it anymore, so UIView just puts it in the first best place.

To correctly execute

setShowsCancelButton:animated:

I think I have to subclass UISearchBar with further method overrides. Unfortunately, I have no idea where to start. Does anyone have a clue or a completely different approach to my problem?


EDIT To make this clear, I have a section index view which blocks the delete "x" and parts of the cancel button. The best thing would be to use the searchbar from the searchDisplayController, which deals with the section index in a reasonable way. Does anyone know how to use this searchbar without all the search display controller supplements?