开发者

How to resize the search bar?

I am trying to put an image on the left side of the search bar. But the problem starts here that the search bar cannot be resized.

Is there any way to do this i.e. resize the search bar and place a s开发者_如何学Cmall image by its side. Help me friends.

Thank You All.


The UISearchBar has a fixed height of 44. If you want to resize the height, you will need to create your own UIView based view that will mimic the appearance of the UISearchBar. If you want to resize the width, that shouldn't be a problem. Just call -setFrame on the UISearchBar. If you want to place a small image to the side of the search bar, just add a UIImageView that you can also call -setFrame on to lay it out according to your requirements.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜