ios - UISearchBar 框架的问题

标签 ios uitableview uisearchbar uisearchdisplaycontroller

我有一个以编程方式创建的 UITableView ,并添加了 UISearchBar/UISearchDisplayController 作为 subview 。它看起来像这样:

enter image description here

这一切都很好,但是当我触摸它来调用搜索时,框架发生了奇怪的变化,知道为什么吗?

enter image description here

我尝试过手动设置框架,但似乎没有帮助。

UITableViewUIViewController 的一个属性。

最佳答案

我认为这是这个问题的重复UIsearchBar. Can't change frame .

答案是你不能弄乱 UISearchBar 的框架。

关于ios - UISearchBar 框架的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21098470/

相关文章:

swift - 除了 .tintColor 之外,还有其他方法可以更改 UITextField 的光标颜色吗?

ios - NSURL URLWithString 到相对 url

objective-c - viewForHeaderInSection - 仅自定义标题标签而不是标题部分框架

ios - 在 uisearchDisplayController '是结果中,如何突出显示在搜索栏中输入的字符串?

ios - Array as a Table 是否易于使用?

ios - 如何在 searchBar 中设置 http 不区分大小写?

ios - 计时器每次触发时都会跳过第一秒?

ios - 获取对 iOS 中顶级 View Controller 的引用

ios - 如何为 UITableview 中的每个部分制作不同的搜索字段?

iOS:背景颜色——UITableView 和 Accessory 具有相同的背景颜色