Changing the size of UISearchBar

我们两清 提交于 2019-12-14 00:37:08

问题


Not being able to find the answer, and also not being able to do what I want with this:

CGSize searchBarSize = self.searchDisplayController.searchBar.frame.size;
searchBarSize.width = <someNumber>;

I ask: is there a way to change the width of a UISearchBar?

Thanks a lot.


回答1:


Just as a reference to anybody with the same problem:

I created a view with the searchBar image (resized) as a button's background (the button was added as a subview to my view).

Then I defined the view containing the button as the view for the table's header in my UiTableViewController.

The button, when pressed, behaves like the searchBar.

I was able to solve my problem.



来源:https://stackoverflow.com/questions/2523385/changing-the-size-of-uisearchbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!