From e3dd54faf4353455d9d9d56c0ab1248034ac9048 Mon Sep 17 00:00:00 2001 From: "naoto.suzuki" Date: Thu, 16 Mar 2023 18:49:09 +0900 Subject: [PATCH] Fixed first scroll position. --- NohanaImagePicker/AssetListViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NohanaImagePicker/AssetListViewController.swift b/NohanaImagePicker/AssetListViewController.swift index df4665d..5c440a1 100644 --- a/NohanaImagePicker/AssetListViewController.swift +++ b/NohanaImagePicker/AssetListViewController.swift @@ -37,6 +37,12 @@ class AssetListViewController: UICollectionViewController, UICollectionViewDeleg view.backgroundColor = nohanaImagePickerController.config.color.background ?? .white setUpToolbarItems() addPickPhotoKitAssetNotificationObservers() + + collectionView.translatesAutoresizingMaskIntoConstraints = false + collectionView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor).isActive = true + collectionView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor).isActive = true + collectionView.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor).isActive = true + collectionView.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor).isActive = true } var cellSize: CGSize {