You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your awesome work.
I found there is a use-case that cause the height always is 0 when using UIScrollView inside the sheet ViewController. Could you please help to take a look and suggest how to fix it properly?
Below is the sample ScrollView within ViewController. This ViewController works normal with default presentation.
import UIKit
final class Label: UILabel {
init(_ text: String) {
super.init(frame: .zero)
self.text = text
textColor = .darkText
}
@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
final class SampleScrollViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let scrollView = UIScrollView()
let stackView = UIStackView(arrangedSubviews: (1...10).map { Label("Text \($0)") })
stackView.axis = .vertical
stackView.spacing = 8
scrollView.addSubview(stackView)
view.addSubview(scrollView)
stackView.translatesAutoresizingMaskIntoConstraints = false
scrollView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
stackView.topAnchor.constraint(equalTo: scrollView.topAnchor),
stackView.bottomAnchor.constraint(equalTo: scrollView.bottomAnchor),
stackView.leadingAnchor.constraint(equalTo: scrollView.leadingAnchor),
stackView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor),
stackView.widthAnchor.constraint(equalTo: view.widthAnchor),
])
NSLayoutConstraint.activate([
scrollView.topAnchor.constraint(equalTo: view.topAnchor),
scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor),
scrollView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
scrollView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
])
}
}
The text was updated successfully, but these errors were encountered:
Thank you for your awesome work.
I found there is a use-case that cause the height always is 0 when using UIScrollView inside the sheet ViewController. Could you please help to take a look and suggest how to fix it properly?
Below is the sample ScrollView within ViewController. This ViewController works normal with default presentation.
The text was updated successfully, but these errors were encountered: