【问题标题】:Empty UISearchbar space when combining search bar with Nav bar in iOS7?在 iOS7 中将搜索栏与导航栏结合时 UISearchbar 空间为空?
【发布时间】:2013-11-11 20:07:10
【问题描述】:

所以我试图将搜索栏与 iOS7 中的 tableview 导航栏结合起来。

我打电话
self.searchDisplayController.displaysSearchBarInNavigationBar = YES; 而且看起来不错。

但是,在导航栏和第一个 tableview 内容之间有一个非常烦人的空白空间(大约是搜索栏的大小)!

我想知道我到底错过了什么?

【问题讨论】:

  • 我找到了一种变通方法:以编程方式将搜索栏的高度设置为 0。不过感觉真的很hacky

标签: uitableview ios7 uisearchbar


【解决方案1】:

我通过删除 2 行代码解决了这个问题。

self.viewController.edgesForExtendedLayout = UIRectEdgeNone; self.navigationBar.translucent = NO;

【讨论】:

    猜你喜欢
    • 2021-06-07
    • 1970-01-01
    • 1970-01-01
    • 2019-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多