Instagram / IGListKit

A data-driven UICollectionView framework for building fast and flexible lists.
https://instagram.github.io/IGListKit/
MIT License
12.88k stars 1.54k forks source link

When use `estimatedItemSize` and there is only one cell in the section: the cell is center aligned (should be aligned left). #520

Closed ShaneQi closed 7 years ago

ShaneQi commented 7 years ago

New issue checklist

General information

This issue is totally reproducible in demo project with two simple steps:

  1. In file MixedDataViewController.swift:
    Change the itemCount to 1.

  2. In viewDidLoad function of file MixedDataViewController.swift:
    Add this snippet of code to set estimated cell size:

    let layout = UICollectionViewFlowLayout()
    layout.estimatedItemSize = CGSize(width: 50, height: 50)
    collectionView.setCollectionViewLayout(layout, animated: false)

Then when run the project and goto Mixed Data view, it will turn out to be like: (The single cell section center aligns the cell, which should be aligned left.)

screen shot 2017-02-28 at 6 16 05 pm
jessesquires commented 7 years ago

Probably just as to do with item spacing or other flow layout settings?

ShaneQi commented 7 years ago

I tried the same without IGListKit, the issue still exists. It turned out not a issue of IGListKit.

Sorry for mis-reporting. I will close this issue.

filippkos commented 1 year ago

Did you manage to find a solution to this problem?

heykomikmi commented 1 year ago

Hacked

iPhone’umdan gönderildi

Filipp Kosenko @.***> şunları yazdı (14 May 2023 ÖS 12:19):



Did you manage to find a solution to this problem?

— Reply to this email directly, view it on GitHubhttps://github.com/Instagram/IGListKit/issues/520#issuecomment-1546852839, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7KYAEAYWMX2F4IJY7D5RB3XGCPQRANCNFSM4DB4H2BA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ShaneQi commented 1 year ago

@filippkos @heykomikmi

TBH I don't remember how I worked around it. I think I customized the collectionview flowlayout for the cell to be where I wanted it to be at.