开发者

subclass uisearchbar to show text input field instead of scope bar

开发者 https://www.devze.com 2023-02-15 01:58 出处:网络
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.

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

精彩评论

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