Fix content-page-size (#690)

This commit is contained in:
Nathan Mattes 2023-01-08 13:35:08 +01:00
parent 44d85e0263
commit 04f19b6b9d
2 changed files with 10 additions and 5 deletions

View File

@ -54,8 +54,8 @@ class WelcomeContentCollectionViewCell: UICollectionViewCell {
private func setupConstraints() {
let constraints = [
blurryBackgroundView.topAnchor.constraint(equalTo: topAnchor),
blurryBackgroundView.leadingAnchor.constraint(equalTo: leadingAnchor),
trailingAnchor.constraint(equalTo: blurryBackgroundView.trailingAnchor),
blurryBackgroundView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16),
trailingAnchor.constraint(equalTo: blurryBackgroundView.trailingAnchor, constant: 16),
bottomAnchor.constraint(greaterThanOrEqualTo: blurryBackgroundView.bottomAnchor),
contentStackView.topAnchor.constraint(equalTo: blurryBackgroundView.contentView.topAnchor, constant: 8),

View File

@ -62,10 +62,8 @@ final class WelcomeViewController: UIViewController, NeedsDependency {
private(set) lazy var pageCollectionView: UICollectionView = {
let flowLayout = UICollectionViewFlowLayout()
flowLayout.scrollDirection = .horizontal
flowLayout.minimumInteritemSpacing = 0
flowLayout.minimumLineSpacing = 0
//FIXME: cell-size.
flowLayout.itemSize = CGSize(width: self.view.frame.width, height: 300)
flowLayout.itemSize = CGSize(width: self.view.frame.width, height: 400)
let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
collectionView.translatesAutoresizingMaskIntoConstraints = false
@ -179,6 +177,13 @@ extension WelcomeViewController {
setupIllustrationLayout()
setupButtonShadowView()
let flowLayout = UICollectionViewFlowLayout()
flowLayout.scrollDirection = .horizontal
flowLayout.minimumLineSpacing = 0
flowLayout.itemSize = CGSize(width: self.view.frame.width, height: 400)
pageCollectionView.setCollectionViewLayout(flowLayout, animated: true)
}
private var computedTopAnchorInset: CGFloat {