From 2ea8253e25c5b6cac5e71c575548c0ff5dadb725 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 7 Dec 2019 11:53:53 -0700 Subject: [PATCH] Make navigation and toolbars transparent. Issue #1413 --- iOS/AppAssets.swift | 4 ---- iOS/Article/ArticleViewController.swift | 10 ++++++++++ iOS/Base.lproj/Main.storyboard | 7 +++---- .../InteractiveNavigationController.swift | 3 --- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/iOS/AppAssets.swift b/iOS/AppAssets.swift index 318a50643..96cad2b37 100644 --- a/iOS/AppAssets.swift +++ b/iOS/AppAssets.swift @@ -69,10 +69,6 @@ struct AppAssets { return UIColor(named: "iconBackgroundColor")! }() - static var barBackgroundColor: UIColor = { - return UIColor(named: "barBackgroundColor")! - }() - static var circleClosedImage: UIImage = { return UIImage(systemName: "largecircle.fill.circle")! }() diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index 0d5ec6980..ec87494ff 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -124,6 +124,16 @@ class ArticleViewController: UIViewController { self.webView = webView self.webViewContainer.addChildAndPin(webView) + + webView.translatesAutoresizingMaskIntoConstraints = false + self.webViewContainer.addSubview(webView) + NSLayoutConstraint.activate([ + self.webViewContainer.leadingAnchor.constraint(equalTo: webView.leadingAnchor), + self.webViewContainer.trailingAnchor.constraint(equalTo: webView.trailingAnchor), + self.webViewContainer.topAnchor.constraint(equalTo: webView.topAnchor), + self.webViewContainer.bottomAnchor.constraint(equalTo: webView.bottomAnchor) + ]) + webView.navigationDelegate = self webView.uiDelegate = self self.configureContextMenuInteraction() diff --git a/iOS/Base.lproj/Main.storyboard b/iOS/Base.lproj/Main.storyboard index 3047563b1..c16a87a55 100644 --- a/iOS/Base.lproj/Main.storyboard +++ b/iOS/Base.lproj/Main.storyboard @@ -17,7 +17,7 @@ - + @@ -38,9 +38,9 @@ - + - + @@ -155,7 +155,6 @@ - diff --git a/iOS/UIKit Extensions/InteractiveNavigationController.swift b/iOS/UIKit Extensions/InteractiveNavigationController.swift index 1cf98237a..44b0b7dfa 100644 --- a/iOS/UIKit Extensions/InteractiveNavigationController.swift +++ b/iOS/UIKit Extensions/InteractiveNavigationController.swift @@ -58,17 +58,14 @@ private extension InteractiveNavigationController { func configure() { isToolbarHidden = false - view.backgroundColor = AppAssets.barBackgroundColor let navigationAppearance = UINavigationBarAppearance() - navigationAppearance.backgroundColor = AppAssets.barBackgroundColor navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] navigationBar.standardAppearance = navigationAppearance navigationBar.tintColor = AppAssets.primaryAccentColor let toolbarAppearance = UIToolbarAppearance() - toolbarAppearance.backgroundColor = AppAssets.barBackgroundColor toolbar.standardAppearance = toolbarAppearance toolbar.compactAppearance = toolbarAppearance toolbar.tintColor = AppAssets.primaryAccentColor