PDA

View Full Version : replace default search icon in UISearchBar with custom button




Battery
Mar 5, 2009, 09:34 AM
Hi All,

Could anyone help with replacing default search icon in UISearchBar with custom button, like in Twitter application for Iphone? You could see example in attachment.

So I want to do some other actions for left part of UISearchBar.

Thanks



jnic
Mar 5, 2009, 09:45 AM
Hi All,

Could anyone help with replacing default search icon in UISearchBar with custom button, like in Twitter application for Iphone? You could see example in attachment.

So I want to do some other actions for left part of UISearchBar.

Thanks

If you replace your UISearchBar with a UITextField (https://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITextField_Class/Reference/UITextField.html) then you can set left and right UIViews on the bar (leftView and rightView respectively), which is presumably what Twitter have done here.