From 04f19b6b9d458a7465b90165c2f10131148bbbe1 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sun, 8 Jan 2023 13:35:08 +0100 Subject: [PATCH] Fix content-page-size (#690) --- .../View/Pages/WelcomeContentCollectionViewCell.swift | 4 ++-- .../Onboarding/Welcome/WelcomeViewController.swift | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Mastodon/Scene/Onboarding/Welcome/View/Pages/WelcomeContentCollectionViewCell.swift b/Mastodon/Scene/Onboarding/Welcome/View/Pages/WelcomeContentCollectionViewCell.swift index 05627a02d..413c7644a 100644 --- a/Mastodon/Scene/Onboarding/Welcome/View/Pages/WelcomeContentCollectionViewCell.swift +++ b/Mastodon/Scene/Onboarding/Welcome/View/Pages/WelcomeContentCollectionViewCell.swift @@ -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), diff --git a/Mastodon/Scene/Onboarding/Welcome/WelcomeViewController.swift b/Mastodon/Scene/Onboarding/Welcome/WelcomeViewController.swift index 8c3854565..ad3318940 100644 --- a/Mastodon/Scene/Onboarding/Welcome/WelcomeViewController.swift +++ b/Mastodon/Scene/Onboarding/Welcome/WelcomeViewController.swift @@ -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 {