mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 17:23:25 +01:00
Revises Settings UI
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user