1
2

More than 3 years have passed since last update.

iOS13でUICollectionViewCellの大きさがUIImageViewによってSelf-Sizingされてしまう問題

Posted at

雑ですいません、自分用のメモです
何度もググってるので

ソースはこちら
https://stackoverflow.com/questions/56840665/why-on-xcode-11-uicollectionviewcell-changes-size-as-soon-as-you-scroll-i-alre

Xcode11でってなってますけど、iOS13でですよね?

スクリーンショット 2020-08-16 3.19.53.png

UICollectionViewのEstimate SizeがAutomaticになっていますが、これをNoneにします
これでUICollectionViewDelegateFlowLayoutのsize設定が効きます。

もちろんSelf-Sizingに対応してしまう手もあります(UIImageViewに縦横制約を設定する)
しかしその場合はiOS12でSelf-Sizingを使用できるようにして置かなければならないので注意しましょう。
invalidateLayoutでいけます。

参考
https://qiita.com/usagimaru/items/e0a4c449d4cdf341e152

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2