我提到了来自苹果的“分段导航”范式的一些新趋势。在Apple Music、Health或News等应用程序中,所有主要的“起点”控制器都没有导航栏。相反-有一个大胆的美丽的大标题。我也想在我的应用程序中做同样的事情。我用静态单元格创建了UITableViewController。第一个包含控制器的标题。
但是当我向上滚动时,状态栏与这个单元合并,所以我希望这个单元格在状态栏后面,就像在Apple应用程序中一样。



发布于 2017-04-12 17:58:41
溶液
let statusBarView = UIView(frame: CGRect(x:0, y:0, width:view.frame.size.width, height: UIApplication.shared.statusBarFrame.height))
let blurEffect = UIBlurEffect(style: .light)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = statusBarView.bounds
blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
statusBarView.addSubview(blurEffectView)
UIApplication.shared.windows.first?.addSubview(statusBarView)https://stackoverflow.com/questions/43369047
复制相似问题