UICollectionView in landscape on iPhone X

前端 未结 6 721
余生分开走
余生分开走 2021-01-31 02:41

When iPhone X is used landscape, you\'re supposed to check safeAreaInsets to make suitably large gutters on the left and right. UITableView has the new insetsContentViewsT

6条回答
  •  半阙折子戏
    2021-01-31 03:10

    UICollectionView is intended to be flexible for a wide variety of layouts. The most common layouts are grids with multiple rows and columns, but it's possible to create non-grid layouts with UICollectionView.

    UITableView, on the other hand, is designed for full-width cells.

    Therefore, it makes sense that UITableView would have built-in support for dealing with safe area insets, since table view layouts will always be affected by it. Because UICollectionView uses custom layouts, it makes sense to solve these issues on a per-implementation basis instead of trying to provide a one-size-fits-all solution.

提交回复
热议问题