automaticDimension is ignored, only estimatedRowHeight is used as Height

4
closed
peterpaulis
peterpaulis
Posted 5 months ago

automaticDimension is ignored, only estimatedRowHeight is used as Height #468

Description

The height of the skeleton cell should be calculated using autolayout based upon it's content, but the cell has always the height from estimatedRowHeight, no matter when providing delegate or rowHeight == UITableView.automaticDimension

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

SkeletonView Environment:

**SkeletonView version:1.26.0 ** Xcode version:13.1 (13A1030d) Swift version:5

Steps to reproduce:

The height of the skeleton cell should be calculated using autolayout based upon it's content, but the cell has always the height from estimatedRowHeight, no matter when providing delegate or rowHeight == UITableView.automaticDimension

the docu only states

1️⃣ If you are using resizable cells (tableView.rowHeight = UITableViewAutomaticDimension), it's mandatory define the estimatedRowHeight.

but not, that the an exact size is the only option and you are left out of automaticDimension :( so i suppose this is a bug?

Expected result:

height of the sekelton cell should be based upon UITableView.automaticDimension not estimatedRowHeight

Actual result:

estimatedRowHeight is always used, no matter the content

Juanpe
Juanpe
Created 5 months ago

Hi @peterpaulis 👋🏼

Yep, you're right. Now, SkeletonView neither calculates the height of the cells nor considers the value provided by the delegate.

There is an open PR to allow to specify the height for each cell. #460

peterpaulis
peterpaulis
Created 5 months ago

i believe this to be a very important feature... as you can display the table with different kinds of cells, have the skeleton cell match the content (like when you have a text size setting) or have random skeleton content (which changes the height)... looking forward for this to be added to main

as i understand the problem may be in calculating the number of desired cells to fill the table... in this context it would be ok i believe for the programmer to provide a really large number of rows (e.g. 999) as the cell reuse is very effective and only the displayed cells are handled... so basically it has no impact if there are 7 visible cells and 992 not visible, or just 7 visible

Juanpe
Juanpe
Created 4 months ago

Duplicate of #424

Juanpe
Juanpe
Created 4 months ago

I'm going to close this issue because it's duplicated with #424

Thanks