Unfortunately, UISearchBar not intended to directly support this. In doing what we want, it is likely that we will have to use workarounds that can compromise visually or functionally, or write a lot of code to set up.
I have outlined several approaches that come close to what we want and which can be useful.
Access to the Subviews Approach
The text inside the UISearchBar is a UITextField , which is a subset of this UISearchBar and is accessible through the usually means ie view.subviews .
The magnifying glass search icon is the UIImageView in the leftView property of the UITextField . We can switch it to the right using the following code:
// The text within a UISearchView is a UITextField that is a subview of that UISearchView. UITextField *searchField; for (UIView *subview in self.searchBar.subviews) { if ([subview isKindOfClass:[UITextField class]]) { searchField = (UITextField *)subview; break; } } // The icon is accessible through the 'leftView' property of the UITextField. // We set it to the 'rightView' instead. if (searchField) { UIView *searchIcon = searchField.leftView; if ([searchIcon isKindOfClass:[UIImageView class]]) { NSLog(@"aye"); } searchField.rightView = searchIcon; searchField.leftViewMode = UITextFieldViewModeNever; searchField.rightViewMode = UITextFieldViewModeAlways; }
This gives us the following result:

As you can see, the icon overflows the edge of the rounded rectangle, and the clear icon disappears. In addition, the rightView property is for other content, such as a search results button and bookmarks button. Enabling the search icon may conflict to some extent with this functionality, even if you were able to use offset offsets to position it correctly.
At least you can use this approach to retrieve the icon in the form of a UIImageView and place it explicitly where you consider it necessary, like any other view, and write your own code to handle transition events, etc.
Customize Appearance
In iOS v5.0 , and then you can customize the look of the search strings using the methods listed here . The following code uses offsets to place the icon and text in a UISearchBar :
[self.searchBar setPositionAdjustment:UIOffsetMake(255, 0) forSearchBarIcon:UISearchBarIconSearch]; [self.searchBar setSearchTextPositionAdjustment:UIOffsetMake(-270, 0)];
A standard UISearchBar width of 320 wide is as follows:

This will lead to the fact that all the functionality of the event will be related to the fact that the icon works as expected, but, unfortunately, the UITextField confused and, despite its width, it displays only a very small part of the text. If you could find a way to show text outside of what it thinks is the end of a UITextField , this would probably be your best bet.