CollectionView 的 Cell 自適應相同的行數以及間距

Zhi-Hong Lin
1 min readMar 20, 2019

--

記錄一下,有時候我們會需要在每種裝置裡 collectionView 的 cell 都顯示相同的行數以及間距,以下這段 code 教你如何計算正確的 cell 寬度來達到需求

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response