In iOS7 the search icon and place holder text are always appearing in middle.I tried changing the text alignment of the text field in search bar to left but it didn\'t work.
There is no way to change the alignment of search bar's placeholder text, I tried so many "SO" answer but no one was working. Finally I ended with this workaround
Give some white space in right of placeholder text
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
self.searchBar.placeholder = @"hello";
} else {
// Load resources for iOS 7 or later
self.searchBar.placeholder = @"hello ";
}
Enjoy !!