Commit c173989f by Daniel Dahan

development: updated alignment for navigation controller types

parent c57e2d79
...@@ -164,26 +164,21 @@ open class ControlView: View { ...@@ -164,26 +164,21 @@ open class ControlView: View {
if willRenderView { if willRenderView {
layoutIfNeeded() layoutIfNeeded()
var lc = 0
var rc = 0
let l = (CGFloat(leftControls.count) * interimSpace) let l = (CGFloat(leftControls.count) * interimSpace)
let r = (CGFloat(rightControls.count) * interimSpace) let r = (CGFloat(rightControls.count) * interimSpace)
let p = width - l - r - contentEdgeInsets.left - contentEdgeInsets.right let p = width - l - r - contentEdgeInsets.left - contentEdgeInsets.right
var lc = 0 let columns = Int(p / gridFactor)
var rc = 0
let columns = Int(p / gridFactor)
grid.deferred = true grid.deferred = true
grid.views.removeAll() grid.views.removeAll()
grid.axis.columns = columns grid.axis.columns = columns
for v in leftControls { for v in leftControls {
var w: CGFloat = 0 (v as? UIButton)?.contentEdgeInsets = .zero
if let b = v as? UIButton { v.sizeToFit()
b.contentEdgeInsets = .zero v.grid.columns = Int(ceil(v.width / gridFactor)) + 1
b.sizeToFit()
w = b.width
}
v.height = frame.size.height - contentEdgeInsets.top - contentEdgeInsets.bottom
v.grid.columns = Int(ceil(w / gridFactor)) + 1
lc += v.grid.columns lc += v.grid.columns
...@@ -193,14 +188,9 @@ open class ControlView: View { ...@@ -193,14 +188,9 @@ open class ControlView: View {
grid.views.append(contentView) grid.views.append(contentView)
for v in rightControls { for v in rightControls {
var w: CGFloat = 0 (v as? UIButton)?.contentEdgeInsets = .zero
if let b = v as? UIButton { v.sizeToFit()
b.contentEdgeInsets = .zero v.grid.columns = Int(ceil(v.width / gridFactor)) + 1
b.sizeToFit()
w = b.width
}
v.height = frame.size.height - contentEdgeInsets.top - contentEdgeInsets.bottom
v.grid.columns = Int(ceil(w / gridFactor)) + 1
rc += v.grid.columns rc += v.grid.columns
...@@ -220,6 +210,7 @@ open class ControlView: View { ...@@ -220,6 +210,7 @@ open class ControlView: View {
} }
grid.deferred = false grid.deferred = false
grid.reload()
} }
} }
...@@ -232,7 +223,7 @@ open class ControlView: View { ...@@ -232,7 +223,7 @@ open class ControlView: View {
*/ */
open override func prepareView() { open override func prepareView() {
super.prepareView() super.prepareView()
interimSpacePreset = .interimSpace1 interimSpacePreset = .interimSpace3
contentEdgeInsetsPreset = .square1 contentEdgeInsetsPreset = .square1
autoresizingMask = .flexibleWidth autoresizingMask = .flexibleWidth
prepareContentView() prepareContentView()
...@@ -242,6 +233,5 @@ open class ControlView: View { ...@@ -242,6 +233,5 @@ open class ControlView: View {
private func prepareContentView() { private func prepareContentView() {
contentView = View() contentView = View()
contentView.backgroundColor = nil contentView.backgroundColor = nil
addSubview(contentView)
} }
} }
...@@ -108,13 +108,7 @@ public class GridOffset { ...@@ -108,13 +108,7 @@ public class GridOffset {
public class Grid { public class Grid {
/// Defer the calculation. /// Defer the calculation.
public var deferred = false { public var deferred = false
didSet {
if !deferred {
reload()
}
}
}
/// Context view. /// Context view.
internal weak var context: UIView? internal weak var context: UIView?
......
...@@ -41,6 +41,5 @@ open class IconButton: Button { ...@@ -41,6 +41,5 @@ open class IconButton: Button {
open override func prepareView() { open override func prepareView() {
super.prepareView() super.prepareView()
pulseAnimation = .center pulseAnimation = .center
shapePreset = .circle
} }
} }
...@@ -190,35 +190,32 @@ open class NavigationBar: UINavigationBar { ...@@ -190,35 +190,32 @@ open class NavigationBar: UINavigationBar {
- Parameter item: A UINavigationItem to layout. - Parameter item: A UINavigationItem to layout.
*/ */
internal func layoutNavigationItem(item: UINavigationItem) { internal func layoutNavigationItem(item: UINavigationItem) {
if willRenderView { if willRenderView {
prepareItem(item: item) prepareItem(item: item)
let titleView = prepareTitleView(item: item) let titleView = prepareTitleView(item: item)
let contentView = prepareContentView(item: item) let contentView = prepareContentView(item: item)
titleView.frame.origin = .zero
titleView.frame.size = intrinsicContentSize
var lc = 0
var rc = 0
let l = (CGFloat(item.leftControls.count) * interimSpace) let l = (CGFloat(item.leftControls.count) * interimSpace)
let r = (CGFloat(item.rightControls.count) * interimSpace) let r = (CGFloat(item.rightControls.count) * interimSpace)
let p = width - l - r - contentEdgeInsets.left - contentEdgeInsets.right let p = width - l - r - contentEdgeInsets.left - contentEdgeInsets.right
let columns = Int(p / gridFactor) let columns = Int(p / gridFactor)
titleView.frame.origin = .zero titleView.grid.deferred = true
titleView.frame.size = intrinsicContentSize
titleView.grid.views.removeAll() titleView.grid.views.removeAll()
titleView.grid.axis.columns = columns titleView.grid.axis.columns = columns
contentView.grid.columns = columns
for v in item.leftControls { for v in item.leftControls {
var w: CGFloat = 0 (v as? UIButton)?.contentEdgeInsets = .zero
if let b = v as? UIButton { v.sizeToFit()
b.contentEdgeInsets = .zero v.grid.columns = Int(ceil(v.width / gridFactor)) + 1
b.sizeToFit()
w = b.width
}
v.height = frame.size.height - contentEdgeInsets.top - contentEdgeInsets.bottom
v.grid.columns = Int(ceil(w / gridFactor)) + 1
contentView.grid.columns -= v.grid.columns lc += v.grid.columns
titleView.grid.views.append(v) titleView.grid.views.append(v)
} }
...@@ -226,22 +223,30 @@ open class NavigationBar: UINavigationBar { ...@@ -226,22 +223,30 @@ open class NavigationBar: UINavigationBar {
titleView.grid.views.append(contentView) titleView.grid.views.append(contentView)
for v in item.rightControls { for v in item.rightControls {
var w: CGFloat = 0 (v as? UIButton)?.contentEdgeInsets = .zero
if let b = v as? UIButton { v.sizeToFit()
b.contentEdgeInsets = .zero v.grid.columns = Int(ceil(v.width / gridFactor)) + 1
b.sizeToFit()
w = b.width
}
v.height = frame.size.height - contentEdgeInsets.top - contentEdgeInsets.bottom
v.grid.columns = Int(ceil(w / gridFactor)) + 1
contentView.grid.columns -= v.grid.columns rc += v.grid.columns
titleView.grid.views.append(v) titleView.grid.views.append(v)
} }
titleView.grid.contentEdgeInsets = contentEdgeInsets if .center == item.contentViewAlignment {
if lc < rc {
contentView.grid.columns = columns - 2 * rc
contentView.grid.offset.columns = rc - lc
} else {
contentView.grid.columns = columns - 2 * lc
item.rightControls.first?.grid.offset.columns = lc - rc
}
} else {
contentView.grid.columns = columns - lc - rc
}
titleView.grid.interimSpace = interimSpace titleView.grid.interimSpace = interimSpace
titleView.grid.contentEdgeInsets = contentEdgeInsets
titleView.grid.deferred = false
titleView.grid.reload() titleView.grid.reload()
// contentView alignment. // contentView alignment.
...@@ -265,14 +270,14 @@ open class NavigationBar: UINavigationBar { ...@@ -265,14 +270,14 @@ open class NavigationBar: UINavigationBar {
item.titleLabel.sizeToFit() item.titleLabel.sizeToFit()
item.detailLabel.sizeToFit() item.detailLabel.sizeToFit()
let diff = (contentView.frame.height - item.titleLabel.frame.height - item.detailLabel.frame.height) / 2 let diff = (contentView.height - item.titleLabel.height - item.detailLabel.height) / 2
item.titleLabel.frame.size.height += diff item.titleLabel.height += diff
item.titleLabel.frame.size.width = contentView.frame.width item.titleLabel.width = contentView.width
item.detailLabel.frame.size.height += diff item.detailLabel.height += diff
item.detailLabel.frame.size.width = contentView.frame.width item.detailLabel.width = contentView.width
item.detailLabel.frame.origin.y = item.titleLabel.frame.height item.detailLabel.y = item.titleLabel.height
} }
} else { } else {
item.detailLabel.removeFromSuperview() item.detailLabel.removeFromSuperview()
...@@ -334,7 +339,6 @@ open class NavigationBar: UINavigationBar { ...@@ -334,7 +339,6 @@ open class NavigationBar: UINavigationBar {
if nil == item.contentView { if nil == item.contentView {
item.contentView = UIView(frame: .zero) item.contentView = UIView(frame: .zero)
} }
item.contentView!.grid.axis.direction = .vertical
return item.contentView! return item.contentView!
} }
......
...@@ -112,10 +112,10 @@ open class NavigationController: UINavigationController { ...@@ -112,10 +112,10 @@ open class NavigationController: UINavigationController {
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepareView() {
edgesForExtendedLayout = []
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
automaticallyAdjustsScrollViewInsets = false
// This ensures the panning gesture is available when going back between views. // This ensures the panning gesture is available when going back between views.
if let v = interactivePopGestureRecognizer { if let v = interactivePopGestureRecognizer {
......
...@@ -32,14 +32,16 @@ import UIKit ...@@ -32,14 +32,16 @@ import UIKit
/// A memory reference to the NavigationItem instance. /// A memory reference to the NavigationItem instance.
private var NavigationItemKey: UInt8 = 0 private var NavigationItemKey: UInt8 = 0
private var NavigationItemContext: UInt8 = 0
public class NavigationItem { public class NavigationItem: NSObject {
/** /// Should center the contentView.
A boolean indicating whether keys are being observed open var contentViewAlignment = ContentViewAlignment.center {
on the UINavigationItem. didSet {
*/ navigationBar?.layoutSubviews()
internal var observed = false }
}
/// Back Button. /// Back Button.
public var backButton: IconButton? public var backButton: IconButton?
...@@ -47,10 +49,10 @@ public class NavigationItem { ...@@ -47,10 +49,10 @@ public class NavigationItem {
public var contentView: UIView? public var contentView: UIView?
/// Title label. /// Title label.
public private(set) var titleLabel: UILabel! public private(set) lazy var titleLabel: UILabel = UILabel()
/// Detail label. /// Detail label.
public private(set) var detailLabel: UILabel! public private(set) lazy var detailLabel: UILabel = UILabel()
/// Left controls. /// Left controls.
public var leftControls = [UIView]() public var leftControls = [UIView]()
...@@ -58,30 +60,43 @@ public class NavigationItem { ...@@ -58,30 +60,43 @@ public class NavigationItem {
/// Right controls. /// Right controls.
public var rightControls = [UIView]() public var rightControls = [UIView]()
public var navigationBar: NavigationBar? {
return contentView?.superview?.superview as? NavigationBar
}
open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
guard "titleLabel.textAlignment" == keyPath else {
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
return
}
contentViewAlignment = .center == titleLabel.textAlignment ? .center : .any
}
deinit {
removeObserver(self, forKeyPath: "titleLabel.textAlignment")
}
/// Initializer. /// Initializer.
public init() { public override init() {
prepareTitleLabel() super.init()
prepareTitleLabel()
prepareDetailLabel() prepareDetailLabel()
} }
/// Reloads the subviews for the NavigationBar. /// Reloads the subviews for the NavigationBar.
internal func reload() { internal func reload() {
guard let navigationBar = contentView?.superview?.superview as? NavigationBar else { navigationBar?.layoutSubviews()
return
}
navigationBar.layoutSubviews()
} }
/// Prepares the titleLabel. /// Prepares the titleLabel.
private func prepareTitleLabel() { private func prepareTitleLabel() {
titleLabel = UILabel()
titleLabel.font = RobotoFont.medium(with: 17) titleLabel.font = RobotoFont.medium(with: 17)
titleLabel.textAlignment = .center titleLabel.textAlignment = .center
addObserver(self, forKeyPath: "titleLabel.textAlignment", options: [], context: &NavigationItemContext)
} }
/// Prepares the detailLabel. /// Prepares the detailLabel.
private func prepareDetailLabel() { private func prepareDetailLabel() {
detailLabel = UILabel()
detailLabel.font = RobotoFont.regular(with: 12) detailLabel.font = RobotoFont.regular(with: 12)
detailLabel.textAlignment = .center detailLabel.textAlignment = .center
} }
...@@ -99,9 +114,14 @@ extension UINavigationItem { ...@@ -99,9 +114,14 @@ extension UINavigationItem {
AssociateObject(base: self, key: &NavigationItemKey, value: value) AssociateObject(base: self, key: &NavigationItemKey, value: value)
} }
} }
/// Should center the contentView.
open var contentViewAlignment: ContentViewAlignment {
return navigationItem.contentViewAlignment
}
/// Back Button. /// Back Button.
public internal(set) var backButton: IconButton? { open internal(set) var backButton: IconButton? {
get { get {
return navigationItem.backButton return navigationItem.backButton
} }
...@@ -111,7 +131,7 @@ extension UINavigationItem { ...@@ -111,7 +131,7 @@ extension UINavigationItem {
} }
/// Content View. /// Content View.
public internal(set) var contentView: UIView? { open internal(set) var contentView: UIView? {
get { get {
return navigationItem.contentView return navigationItem.contentView
} }
...@@ -121,7 +141,7 @@ extension UINavigationItem { ...@@ -121,7 +141,7 @@ extension UINavigationItem {
} }
@nonobjc @nonobjc
public var title: String? { open var title: String? {
get { get {
return titleLabel.text return titleLabel.text
} }
...@@ -132,12 +152,12 @@ extension UINavigationItem { ...@@ -132,12 +152,12 @@ extension UINavigationItem {
} }
/// Title Label. /// Title Label.
public var titleLabel: UILabel { open var titleLabel: UILabel {
return navigationItem.titleLabel return navigationItem.titleLabel
} }
/// Detail text. /// Detail text.
public var detail: String? { open var detail: String? {
get { get {
return detailLabel.text return detailLabel.text
} }
...@@ -148,12 +168,12 @@ extension UINavigationItem { ...@@ -148,12 +168,12 @@ extension UINavigationItem {
} }
/// Detail Label. /// Detail Label.
public var detailLabel: UILabel { open var detailLabel: UILabel {
return navigationItem.detailLabel return navigationItem.detailLabel
} }
/// Left side UIViews. /// Left side UIViews.
public var leftControls: [UIView] { open var leftControls: [UIView] {
get { get {
return navigationItem.leftControls return navigationItem.leftControls
} }
...@@ -163,7 +183,7 @@ extension UINavigationItem { ...@@ -163,7 +183,7 @@ extension UINavigationItem {
} }
/// Right side UIViews. /// Right side UIViews.
public var rightControls: [UIView] { open var rightControls: [UIView] {
get { get {
return navigationItem.rightControls return navigationItem.rightControls
} }
......
...@@ -148,13 +148,11 @@ open class PageTabBarController: RootController { ...@@ -148,13 +148,11 @@ open class PageTabBarController: RootController {
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
let w = view.width
let h = view.height
let p = pageTabBar.intrinsicContentSize.height + pageTabBar.grid.layoutEdgeInsets.top + pageTabBar.grid.layoutEdgeInsets.bottom let p = pageTabBar.intrinsicContentSize.height + pageTabBar.grid.layoutEdgeInsets.top + pageTabBar.grid.layoutEdgeInsets.bottom
let y = h - p let y = view.height - p
pageTabBar.height = p pageTabBar.height = p
pageTabBar.width = w + pageTabBar.grid.layoutEdgeInsets.left + pageTabBar.grid.layoutEdgeInsets.right pageTabBar.width = view.width + pageTabBar.grid.layoutEdgeInsets.left + pageTabBar.grid.layoutEdgeInsets.right
rootViewController.view.height = y rootViewController.view.height = y
......
...@@ -47,7 +47,6 @@ open class PhotoLibraryController: UIViewController, PhotoLibraryDelegate { ...@@ -47,7 +47,6 @@ open class PhotoLibraryController: UIViewController, PhotoLibraryDelegate {
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepareView() {
edgesForExtendedLayout = []
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
......
...@@ -151,10 +151,12 @@ open class RootController: UIViewController { ...@@ -151,10 +151,12 @@ open class RootController: UIViewController {
when subclassing. when subclassing.
*/ */
open func prepareView() { open func prepareView() {
edgesForExtendedLayout = []
view.clipsToBounds = true view.clipsToBounds = true
view.backgroundColor = Color.white view.backgroundColor = Color.white
view.contentScaleFactor = Device.scale view.contentScaleFactor = Device.scale
automaticallyAdjustsScrollViewInsets = false
edgesForExtendedLayout = []
prepareRootViewController() prepareRootViewController()
} }
......
...@@ -62,15 +62,13 @@ open class SearchBarController: RootController { ...@@ -62,15 +62,13 @@ open class SearchBarController: RootController {
searchBar.grid.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20 searchBar.grid.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20
let w = view.width
let h = view.height
let p = searchBar.intrinsicContentSize.height + searchBar.grid.layoutEdgeInsets.top + searchBar.grid.layoutEdgeInsets.bottom let p = searchBar.intrinsicContentSize.height + searchBar.grid.layoutEdgeInsets.top + searchBar.grid.layoutEdgeInsets.bottom
searchBar.width = w + searchBar.grid.layoutEdgeInsets.left + searchBar.grid.layoutEdgeInsets.right searchBar.width = view.width + searchBar.grid.layoutEdgeInsets.left + searchBar.grid.layoutEdgeInsets.right
searchBar.height = p searchBar.height = p
rootViewController.view.y = p rootViewController.view.y = p
rootViewController.view.height = h - p rootViewController.view.height = view.height - p
searchBar.divider.reload() searchBar.divider.reload()
} }
......
...@@ -40,16 +40,16 @@ open class Snackbar: BarView { ...@@ -40,16 +40,16 @@ open class Snackbar: BarView {
/// A convenience property to set the titleLabel text. /// A convenience property to set the titleLabel text.
public var text: String? { public var text: String? {
get { get {
return textLabel?.text return textLabel.text
} }
set(value) { set(value) {
textLabel?.text = value textLabel.text = value
layoutSubviews() layoutSubviews()
} }
} }
/// Text label. /// Text label.
public internal(set) var textLabel: UILabel! public internal(set) lazy var textLabel = UILabel()
open override var intrinsicContentSize: CGSize { open override var intrinsicContentSize: CGSize {
return CGSize(width: width, height: 49) return CGSize(width: width, height: 49)
...@@ -97,11 +97,14 @@ open class Snackbar: BarView { ...@@ -97,11 +97,14 @@ open class Snackbar: BarView {
/// Prepares the textLabel. /// Prepares the textLabel.
private func prepareTextLabel() { private func prepareTextLabel() {
textLabel = UILabel()
textLabel.contentScaleFactor = Device.scale textLabel.contentScaleFactor = Device.scale
textLabel.font = RobotoFont.medium(with: 14) textLabel.font = RobotoFont.medium(with: 14)
textLabel.textAlignment = .left textLabel.textAlignment = .left
textLabel.textColor = Color.white textLabel.textColor = Color.white
textLabel.numberOfLines = 0
contentView.grid.deferred = true
contentView.grid.views.append(textLabel) contentView.grid.views.append(textLabel)
contentView.grid.deferred = false
} }
} }
...@@ -45,7 +45,7 @@ open class Toolbar: BarView { ...@@ -45,7 +45,7 @@ open class Toolbar: BarView {
} }
/// Title label. /// Title label.
open internal(set) var titleLabel = UILabel() open internal(set) lazy var titleLabel = UILabel()
/// A convenience property to set the detailLabel text. /// A convenience property to set the detailLabel text.
open var detail: String? { open var detail: String? {
...@@ -59,11 +59,10 @@ open class Toolbar: BarView { ...@@ -59,11 +59,10 @@ open class Toolbar: BarView {
} }
/// Detail label. /// Detail label.
open internal(set) var detailLabel = UILabel() open internal(set) lazy var detailLabel = UILabel()
deinit { deinit {
removeObserver(self, forKeyPath: "titleLabel.textAlignment") removeObserver(self, forKeyPath: "titleLabel.textAlignment")
removeObserver(self, forKeyPath: "detailLabel.textAlignment")
} }
/** /**
...@@ -94,7 +93,11 @@ open class Toolbar: BarView { ...@@ -94,7 +93,11 @@ open class Toolbar: BarView {
} }
open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { open override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
contentViewAlignment = .center == titleLabel.textAlignment || .center == detailLabel.textAlignment ? .center : .any guard "titleLabel.textAlignment" == keyPath else {
super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)
return
}
contentViewAlignment = .center == titleLabel.textAlignment ? .center : .any
} }
open override func layoutSubviews() { open override func layoutSubviews() {
...@@ -146,21 +149,23 @@ open class Toolbar: BarView { ...@@ -146,21 +149,23 @@ open class Toolbar: BarView {
*/ */
open override func prepareView() { open override func prepareView() {
super.prepareView() super.prepareView()
contentViewAlignment = .center
prepareTitleLabel() prepareTitleLabel()
prepareDetailLabel() prepareDetailLabel()
} }
/// Prepares the titleLabel. /// Prepares the titleLabel.
private func prepareTitleLabel() { private func prepareTitleLabel() {
titleLabel.contentScaleFactor = Device.scale titleLabel.contentScaleFactor = Device.scale
titleLabel.font = RobotoFont.medium(with: 17) titleLabel.font = RobotoFont.medium(with: 17)
titleLabel.textAlignment = .center
addObserver(self, forKeyPath: "titleLabel.textAlignment", options: [], context: &ToolbarContext) addObserver(self, forKeyPath: "titleLabel.textAlignment", options: [], context: &ToolbarContext)
} }
/// Prepares the detailLabel. /// Prepares the detailLabel.
private func prepareDetailLabel() { private func prepareDetailLabel() {
detailLabel.contentScaleFactor = Device.scale detailLabel.contentScaleFactor = Device.scale
detailLabel.font = RobotoFont.regular(with: 12) detailLabel.font = RobotoFont.regular(with: 12)
addObserver(self, forKeyPath: "detailLabel.textAlignment", options: [], context: &ToolbarContext) detailLabel.textAlignment = .center
} }
} }
...@@ -165,15 +165,13 @@ open class ToolbarController: RootController { ...@@ -165,15 +165,13 @@ open class ToolbarController: RootController {
toolbar.grid.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20 toolbar.grid.layoutEdgeInsets.top = .phone == Device.userInterfaceIdiom && Device.isLandscape ? 0 : 20
let w = view.width
let h = view.height
let p = toolbar.intrinsicContentSize.height + toolbar.grid.layoutEdgeInsets.top + toolbar.grid.layoutEdgeInsets.bottom let p = toolbar.intrinsicContentSize.height + toolbar.grid.layoutEdgeInsets.top + toolbar.grid.layoutEdgeInsets.bottom
toolbar.width = w + toolbar.grid.layoutEdgeInsets.left + toolbar.grid.layoutEdgeInsets.right toolbar.width = view.width + toolbar.grid.layoutEdgeInsets.left + toolbar.grid.layoutEdgeInsets.right
toolbar.height = p toolbar.height = p
rootViewController.view.y = p rootViewController.view.y = p
rootViewController.view.height = h - p rootViewController.view.height = view.height - p
toolbar.divider.reload() toolbar.divider.reload()
} }
......
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