Revises Settings UI

This commit is contained in:
Riley Testut
2019-09-05 11:59:10 -07:00
parent 859f8a255c
commit 6635565a1c
11 changed files with 952 additions and 392 deletions

View File

@@ -12,6 +12,8 @@ import Roxas
class NavigationBar: UINavigationBar
{
private let backgroundColorView = UIView()
override init(frame: CGRect)
{
super.init(frame: frame)
@@ -28,14 +30,31 @@ class NavigationBar: UINavigationBar
private func initialize()
{
self.barTintColor = .white
self.shadowImage = UIImage()
if let tintColor = self.barTintColor
{
self.backgroundColorView.backgroundColor = tintColor
// Top = -50 to cover status bar area above navigation bar on any device.
// Bottom = -1 to prevent a flickering gray line from appearing.
self.addSubview(self.backgroundColorView, pinningEdgesWith: UIEdgeInsets(top: -50, left: 0, bottom: -1, right: 0))
}
else
{
self.barTintColor = .white
}
}
override func layoutSubviews()
{
super.layoutSubviews()
if self.backgroundColorView.superview != nil
{
self.insertSubview(self.backgroundColorView, at: 1)
}
// We can't easily shift just the back button up, so we shift the entire content view slightly.
for contentView in self.subviews
{