【问题标题】:Set status bar color to match UISearchBar设置状态栏颜色以匹配 UISearchBar
【发布时间】:2015-09-15 15:33:06
【问题描述】:

我有一个搜索视图,它显示一个 UITableView 和一个 UISearchBar 作为 tableHeaderView。滚动表格,文本重叠并显示在状态栏下方。我尝试过的所有解决方案都不起作用。我的偏好是将状态栏设为灰色,以匹配 UISearchBar,如建议的 here

我尝试过的其他方法都没有奏效。任何帮助将不胜感激。

【问题讨论】:

    标签: ios swift uitableview uistatusbar


    【解决方案1】:

    以下工作:

    func positionForBar(bar: UIBarPositioning) -> UIBarPosition {
        return .TopAttached
    }
    

    但副作用是现在搜索栏和第一个表格单元格之间存在偏移。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-05
      • 1970-01-01
      • 1970-01-01
      • 2016-03-30
      • 1970-01-01
      • 2013-03-20
      相关资源
      最近更新 更多