如果我删除navigationBar阴影:
self.navigationController?.navigationBar.shadowImage = UIImage()
如何添加阴影?
答案 0 :(得分:2)
//Extension
extension UINavigationBar {
func shouldRemoveShadow(_ value: Bool) -> Void {
if value {
self.setValue(true, forKey: "hidesShadow")
} else {
self.setValue(false, forKey: "hidesShadow")
}
}
}
//Use in view controller.
self.navigationController?.navigationBar.shouldRemoveShadow(true)
答案 1 :(得分:1)