Skip to content

Commit

Permalink
Fix border line for the navigation bar for landscape orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Jun 29, 2023
1 parent cc6b426 commit a0772b4
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,14 +458,15 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega
navigationItem.titleView = navigationBarManager.blogTitleViewLabel

// Add bottom border line
let borderBottom = CALayer()
let screenScale = UIScreen.main.scale
let borderWidth: CGFloat = 1.0 / screenScale
let borderColor = UIColor(red: 60/255, green: 60/255, blue: 67/255, alpha: 0.36).cgColor
borderBottom.borderColor = borderColor
borderBottom.borderWidth = borderWidth

let borderBottom = UIView()
borderBottom.backgroundColor = UIColor(cgColor: borderColor)
borderBottom.frame = CGRect(x: 0, y: navigationController?.navigationBar.frame.size.height ?? 0 - borderWidth, width: navigationController?.navigationBar.frame.size.width ?? 0, height: borderWidth)
navigationController?.navigationBar.layer.addSublayer(borderBottom)
borderBottom.autoresizingMask = [.flexibleWidth, .flexibleTopMargin]
navigationController?.navigationBar.addSubview(borderBottom)
}

private func reloadBlogTitleView() {
Expand Down

0 comments on commit a0772b4

Please sign in to comment.