【发布时间】:2016-03-10 02:27:36
【问题描述】:
我正在尝试在我的 Swift iOS 应用程序中获得这种模糊半透明的导航栏效果(图像中的第一个导航栏):
但是我做不到。我尝试了几种方法,其中一些方法如下:
setBackgroundImage, shadowImage and translucent attrs in AppDelegate (Getting the NavController from the RootViewController attr)
AppDelegate main 方法中的那些行:
UINavigationBar.appearance().translucent = true;
UINavigationBar.appearance().barTintColor = UIColor(white: 1, alpha: 0.4)
从 UIBuilder 更改属性
在 viewControllers 中设置 self.automaticallyAdjustsScrollViewInsets = true 和 self.edgesForExtendedLayout = UIRectEdge.None
但仍然无法使其正常工作。我在 XCode 模拟器上运行应用程序,使用 iOS 8.1 和 9.0
我做错了什么?
【问题讨论】:
标签: ios swift cocoa navigation