UISearchBar inputAccessoryView
问题 The UISearchBar seems to have the inputAccessoryView as a readOnly property. How do I set it with my own customToolbar ? 回答1: Edit: As is mentioned in the comments below, this is no longer an issue post iOS 6. See the UISearchBar documentation here. The UIResponder (of which UISearchBar is an indirect subclass of) class documentation details a way to accomplish this: Subclasses that want to attach custom controls to either a system-supplied input view (such as the keyboard) or a custom input