Showing
1 changed file
with
16 additions
and
0 deletions
... | @@ -39,6 +39,22 @@ extension UIViewController { | ... | @@ -39,6 +39,22 @@ extension UIViewController { |
39 | let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton) | 39 | let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton) |
40 | self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false) | 40 | self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false) |
41 | self.navigationItem.title = "" | 41 | self.navigationItem.title = "" |
42 | + | ||
43 | + // Add backgroundColor | ||
44 | + let navigationBarAppearance = UINavigationBarAppearance() | ||
45 | + navigationBarAppearance.configureWithDefaultBackground() | ||
46 | + navigationBarAppearance.backgroundColor = .white | ||
47 | + | ||
48 | + navigationItem.standardAppearance = navigationBarAppearance | ||
49 | + navigationItem.compactAppearance = navigationBarAppearance | ||
50 | + navigationItem.scrollEdgeAppearance = navigationBarAppearance | ||
51 | + | ||
52 | + // Add shadow | ||
53 | + self.navigationController?.navigationBar.layer.masksToBounds = false | ||
54 | + self.navigationController?.navigationBar.layer.shadowColor = UIColor.lightGray.cgColor | ||
55 | + self.navigationController?.navigationBar.layer.shadowOpacity = 0.8 | ||
56 | + self.navigationController?.navigationBar.layer.shadowOffset = CGSize(width: 0, height: 2.0) | ||
57 | + self.navigationController?.navigationBar.layer.shadowRadius = 2 | ||
42 | } | 58 | } |
43 | 59 | ||
44 | 60 | ... | ... |
-
Please register or login to post a comment