<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>xyk</author_name>
  <author_url>https://blog.hatena.ne.jp/xyk/</author_url>
  <blog_title>xyk blog</blog_title>
  <blog_url>https://xyk.hatenablog.com/</blog_url>
  <categories>
    <anon>ios</anon>
    <anon>swift</anon>
    <anon>UICollectionView</anon>
  </categories>
  <description>検証環境: Xcode 12.4 Swift 5.3.2 UICollectionView のセルの横幅をいい感じに調整する方法について。 前提条件として、セルの並び方向はデフォルトのflowLayout.scrollDirection = .vertical、セルのサイズは正方形ですべてのセルが同じサイズであること。 セルの横幅に固定値を指定した場合、セル間の間隔はシステム側で自動に調整してくれるが、セル間の間隔が広くなってしまうと見た目がよくない。 また端末によって画面サイズが違うので1行に配置されるセル数や間隔も変わってくる。 固定値でなく例えば1行にセルが3列入るように横幅を計算する方…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fxyk.hatenablog.com%2Fentry%2F2021%2F02%2F15%2F141654&quot; title=&quot;UICollectionViewCell の横幅を計算する - xyk blog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/x/xyk/20210215/20210215142610.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-02-15 14:16:54</published>
  <title>UICollectionViewCell の横幅を計算する</title>
  <type>rich</type>
  <url>https://xyk.hatenablog.com/entry/2021/02/15/141654</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
