Commit 17733f51 by intoxicated

Fixed iOS 11 navigationBar layoutMargin to zero

parent 0eb7acf7
......@@ -134,6 +134,13 @@ open class NavigationBar: UINavigationBar {
layoutShape()
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 {
layoutNavigationItem(item: v)
}
......@@ -141,7 +148,6 @@ open class NavigationBar: UINavigationBar {
if let v = backItem {
layoutNavigationItem(item: v)
}
layoutDivider()
}
......@@ -155,10 +161,10 @@ open class NavigationBar: UINavigationBar {
open func prepare() {
barStyle = .black
isTranslucent = false
depthPreset = .depth1
depthPreset = .none
contentScaleFactor = Screen.scale
contentEdgeInsetsPreset = .square1
interimSpacePreset = .interimSpace3
contentEdgeInsetsPreset = .none
interimSpacePreset = .none
backButtonImage = Icon.cm.arrowBack
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