Skip to content

Dynamically size cells to adjusted height #2

@alexrmacleod

Description

@alexrmacleod

I was looking around stackoverflow for answers on this and yours seemed to be the best on this random question about dynamic cell resizing.

I have a UiCollectionView and I am looking to dynamically size cells according to their height relative to the devices width.

Each photo object thats placing data into the cells has their height and width data. like so

var adjustedHeight:CFloat? adjustedHeight = Float(view.bounds.width) * photo.standardResolutionImageHeight / photo.standardResolutionImageWidth

Will your solution work for this situation? Looking to dynamically adjust the height of each cell relative to the fixed width of any iOS device for each photo.

Check out my app. www.tipp3d.com to see the collectionview I am talking about.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions