Put document controls view in a scroll view
This commit is contained in:
29
App/Document Controls UI/DocumentControlsView.swift
Normal file
29
App/Document Controls UI/DocumentControlsView.swift
Normal file
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// DocumentControlsView.swift
|
||||
// App
|
||||
//
|
||||
// Created by James Magahern on 4/28/21.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class DocumentControlsView : UIScrollView
|
||||
{
|
||||
public let stackView = StackView<DocumentControlItemView>(dimension: .vertical)
|
||||
|
||||
convenience init() {
|
||||
self.init(frame: .zero)
|
||||
addSubview(stackView)
|
||||
}
|
||||
|
||||
override func layoutSubviews() {
|
||||
super.layoutSubviews()
|
||||
|
||||
let stackViewSize = stackView.sizeThatFits(CGSize(width: bounds.width, height: -1))
|
||||
stackView.frame = CGRect(
|
||||
origin: .zero, size: stackViewSize
|
||||
)
|
||||
|
||||
contentSize = stackViewSize
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user