Commit bdea9aba by Daniel Dahan Committed by GitHub

Merge pull request #1038 from intoxicated/master

Removed NavigationBar margin for iOS 11
parents 904324b9 17733f51
...@@ -134,6 +134,13 @@ open class NavigationBar: UINavigationBar { ...@@ -134,6 +134,13 @@ open class NavigationBar: UINavigationBar {
layoutShape() layoutShape()
layoutShadowPath() layoutShadowPath()
//iOS 11 added left/right layout margin in subviews of UINavigationBar
//since we do not want to unsafely access private view directly
//iterate subviews to set `layoutMargin` to zero
for view in subviews {
view.layoutMargins = .zero
}
if let v = topItem { if let v = topItem {
layoutNavigationItem(item: v) layoutNavigationItem(item: v)
} }
...@@ -141,7 +148,6 @@ open class NavigationBar: UINavigationBar { ...@@ -141,7 +148,6 @@ open class NavigationBar: UINavigationBar {
if let v = backItem { if let v = backItem {
layoutNavigationItem(item: v) layoutNavigationItem(item: v)
} }
layoutDivider() layoutDivider()
} }
...@@ -155,10 +161,10 @@ open class NavigationBar: UINavigationBar { ...@@ -155,10 +161,10 @@ open class NavigationBar: UINavigationBar {
open func prepare() { open func prepare() {
barStyle = .black barStyle = .black
isTranslucent = false isTranslucent = false
depthPreset = .depth1 depthPreset = .none
contentScaleFactor = Screen.scale contentScaleFactor = Screen.scale
contentEdgeInsetsPreset = .square1 contentEdgeInsetsPreset = .none
interimSpacePreset = .interimSpace3 interimSpacePreset = .none
backButtonImage = Icon.cm.arrowBack backButtonImage = Icon.cm.arrowBack
if #available(iOS 11, *) { if #available(iOS 11, *) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment