Put document controls view in a scroll view
This commit is contained in:
@@ -9,14 +9,14 @@ import UIKit
|
||||
|
||||
class DocumentControlViewController: UIViewController
|
||||
{
|
||||
let documentControlView = StackView<DocumentControlView>(dimension: .vertical)
|
||||
let documentControlsView = DocumentControlsView()
|
||||
let fontSizeAdjustView = FontSizeAdjustView()
|
||||
let findOnPageControlView = DocumentControlView()
|
||||
let findOnPageControlView = DocumentControlItemView()
|
||||
let navigationControlView = NavigationControlsView()
|
||||
let settingsView = DocumentControlView()
|
||||
let readabilityView = DocumentControlView()
|
||||
let darkModeView = DocumentControlView()
|
||||
let archiveView = DocumentControlView()
|
||||
let settingsView = DocumentControlItemView()
|
||||
let readabilityView = DocumentControlItemView()
|
||||
let darkModeView = DocumentControlItemView()
|
||||
let archiveView = DocumentControlItemView()
|
||||
|
||||
var observations: [NSKeyValueObservation] = []
|
||||
|
||||
@@ -45,17 +45,17 @@ class DocumentControlViewController: UIViewController
|
||||
|
||||
darkModeView.imageView.image = DarkModeControls.buttonImage(forDarkModeState: darkModeEnabled)
|
||||
|
||||
documentControlView.addArrangedSubview(navigationControlView)
|
||||
documentControlView.addArrangedSubview(fontSizeAdjustView)
|
||||
documentControlView.addArrangedSubview(findOnPageControlView)
|
||||
documentControlView.addArrangedSubview(darkModeView)
|
||||
documentControlView.addArrangedSubview(readabilityView)
|
||||
documentControlView.addArrangedSubview(archiveView)
|
||||
documentControlsView.stackView.addArrangedSubview(navigationControlView)
|
||||
documentControlsView.stackView.addArrangedSubview(fontSizeAdjustView)
|
||||
documentControlsView.stackView.addArrangedSubview(findOnPageControlView)
|
||||
documentControlsView.stackView.addArrangedSubview(darkModeView)
|
||||
documentControlsView.stackView.addArrangedSubview(readabilityView)
|
||||
documentControlsView.stackView.addArrangedSubview(archiveView)
|
||||
|
||||
documentControlView.addArrangedSubview(settingsView)
|
||||
documentControlsView.stackView.addArrangedSubview(settingsView)
|
||||
|
||||
for (i, view) in documentControlView.arrangedSubviews.enumerated() {
|
||||
view.drawsBottomSeparator = (i < documentControlView.arrangedSubviews.count - 1)
|
||||
for (i, view) in documentControlsView.stackView.arrangedSubviews.enumerated() {
|
||||
view.drawsBottomSeparator = (i < documentControlsView.stackView.arrangedSubviews.count - 1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,11 +64,11 @@ class DocumentControlViewController: UIViewController
|
||||
}
|
||||
|
||||
override func loadView() {
|
||||
self.view = documentControlView
|
||||
self.view = documentControlsView
|
||||
}
|
||||
|
||||
override var preferredContentSize: CGSize {
|
||||
get { documentControlView.sizeThatFits(CGSize(width: Self.preferredWidth, height: -1)) }
|
||||
get { documentControlsView.stackView.sizeThatFits(CGSize(width: Self.preferredWidth, height: -1)) }
|
||||
set {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user