开发者

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.

  1. You could subclass UISearchBar and override layoutSubviews, to position your new UITextField. You'll also probably need to handle setFrame, frame, sizeThatFits, etc.

  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜