Make navigation and toolbars transparent. Issue #1413

This commit is contained in:
Maurice Parker 2019-12-07 11:53:53 -07:00
parent d4722f766f
commit 2ea8253e25
4 changed files with 13 additions and 11 deletions

View File

@ -69,10 +69,6 @@ struct AppAssets {
return UIColor(named: "iconBackgroundColor")! return UIColor(named: "iconBackgroundColor")!
}() }()
static var barBackgroundColor: UIColor = {
return UIColor(named: "barBackgroundColor")!
}()
static var circleClosedImage: UIImage = { static var circleClosedImage: UIImage = {
return UIImage(systemName: "largecircle.fill.circle")! return UIImage(systemName: "largecircle.fill.circle")!
}() }()

View File

@ -124,6 +124,16 @@ class ArticleViewController: UIViewController {
self.webView = webView self.webView = webView
self.webViewContainer.addChildAndPin(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.navigationDelegate = self
webView.uiDelegate = self webView.uiDelegate = self
self.configureContextMenuInteraction() self.configureContextMenuInteraction()

View File

@ -17,7 +17,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DNb-lt-KzC"> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DNb-lt-KzC">
<rect key="frame" x="0.0" y="88" width="414" height="725"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
</view> </view>
<view opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iEi-hX-TYy"> <view opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iEi-hX-TYy">
@ -38,9 +38,9 @@
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints> <constraints>
<constraint firstItem="VUw-jc-0yf" firstAttribute="bottom" secondItem="iEi-hX-TYy" secondAttribute="top" id="4fZ-pn-fmB"/> <constraint firstItem="VUw-jc-0yf" firstAttribute="bottom" secondItem="iEi-hX-TYy" secondAttribute="top" id="4fZ-pn-fmB"/>
<constraint firstItem="DNb-lt-KzC" firstAttribute="top" secondItem="VUw-jc-0yf" secondAttribute="top" id="Bfh-RL-m4d"/> <constraint firstItem="DNb-lt-KzC" firstAttribute="top" secondItem="svH-Pt-448" secondAttribute="top" id="Bfh-RL-m4d"/>
<constraint firstItem="A7j-8T-DqE" firstAttribute="trailing" secondItem="VUw-jc-0yf" secondAttribute="trailing" id="Feu-hj-K01"/> <constraint firstItem="A7j-8T-DqE" firstAttribute="trailing" secondItem="VUw-jc-0yf" secondAttribute="trailing" id="Feu-hj-K01"/>
<constraint firstItem="DNb-lt-KzC" firstAttribute="bottom" secondItem="VUw-jc-0yf" secondAttribute="bottom" id="FfW-6G-Bcp"/> <constraint firstItem="DNb-lt-KzC" firstAttribute="bottom" secondItem="svH-Pt-448" secondAttribute="bottom" id="FfW-6G-Bcp"/>
<constraint firstItem="VUw-jc-0yf" firstAttribute="trailing" secondItem="iEi-hX-TYy" secondAttribute="trailing" id="Ij6-ri-sBN"/> <constraint firstItem="VUw-jc-0yf" firstAttribute="trailing" secondItem="iEi-hX-TYy" secondAttribute="trailing" id="Ij6-ri-sBN"/>
<constraint firstItem="iEi-hX-TYy" firstAttribute="leading" secondItem="VUw-jc-0yf" secondAttribute="leading" id="Muc-gr-S7o"/> <constraint firstItem="iEi-hX-TYy" firstAttribute="leading" secondItem="VUw-jc-0yf" secondAttribute="leading" id="Muc-gr-S7o"/>
<constraint firstItem="DNb-lt-KzC" firstAttribute="trailing" secondItem="VUw-jc-0yf" secondAttribute="trailing" id="QJ5-Ne-ndd"/> <constraint firstItem="DNb-lt-KzC" firstAttribute="trailing" secondItem="VUw-jc-0yf" secondAttribute="trailing" id="QJ5-Ne-ndd"/>
@ -155,7 +155,6 @@
<outlet property="delegate" destination="Kyk-vK-QRX" id="rH3-5N-a6z"/> <outlet property="delegate" destination="Kyk-vK-QRX" id="rH3-5N-a6z"/>
</connections> </connections>
</tableView> </tableView>
<extendedEdge key="edgesForExtendedLayout" top="YES"/>
<toolbarItems> <toolbarItems>
<barButtonItem title="Mark All as Read" id="fTv-eX-72r"> <barButtonItem title="Mark All as Read" id="fTv-eX-72r">
<connections> <connections>

View File

@ -58,17 +58,14 @@ private extension InteractiveNavigationController {
func configure() { func configure() {
isToolbarHidden = false isToolbarHidden = false
view.backgroundColor = AppAssets.barBackgroundColor
let navigationAppearance = UINavigationBarAppearance() let navigationAppearance = UINavigationBarAppearance()
navigationAppearance.backgroundColor = AppAssets.barBackgroundColor
navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label] navigationAppearance.titleTextAttributes = [.foregroundColor: UIColor.label]
navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label] navigationAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.label]
navigationBar.standardAppearance = navigationAppearance navigationBar.standardAppearance = navigationAppearance
navigationBar.tintColor = AppAssets.primaryAccentColor navigationBar.tintColor = AppAssets.primaryAccentColor
let toolbarAppearance = UIToolbarAppearance() let toolbarAppearance = UIToolbarAppearance()
toolbarAppearance.backgroundColor = AppAssets.barBackgroundColor
toolbar.standardAppearance = toolbarAppearance toolbar.standardAppearance = toolbarAppearance
toolbar.compactAppearance = toolbarAppearance toolbar.compactAppearance = toolbarAppearance
toolbar.tintColor = AppAssets.primaryAccentColor toolbar.tintColor = AppAssets.primaryAccentColor