subclass uisearchbar to show text input field instead of scope bar
Is there a way to have a text field input show up instead of a scope b开发者_如何学Goar for uisearchbar?
There are a couple approaches.
You could subclass UISearchBar and override layoutSubviews, to position your new UITextField. You'll also probably need to handle setFrame, frame, sizeThatFits, etc.
You could create a new composite control, that is, a new control that contains both a USSearchBar and a UITextField. This is likely the safer and easier approach.
精彩评论