我有一个以编程方式创建的 UITableView
,并添加了 UISearchBar
/UISearchDisplayController
作为 subview 。它看起来像这样:
这一切都很好,但是当我触摸它来调用搜索时,框架发生了奇怪的变化,知道为什么吗?
我尝试过手动设置框架,但似乎没有帮助。
UITableView
是 UIViewController
的一个属性。
最佳答案
我认为这是这个问题的重复UIsearchBar. Can't change frame .
答案是你不能弄乱 UISearchBar 的框架。
关于ios - UISearchBar 框架的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21098470/