heightforrowatindexpath

how do I calculate heightForRowAtIndexPath when the cell is not even constructed yet?

早过忘川 提交于 2019-11-30 01:02:08
Question - How does one best calculate the height for a row in the "heightForRowAtIndexPath" method of a UITableViewController, given that: I'm using a custom subclassed UITableViewCell & the actually size of the subview (e.g. UILabels) is calculated at runtime & dependant on things such as if the user changed the font size the cell's aren't actually prepared it seems prior to a "heightForRowAtIndexPath", so you can't rely on calling your specific custom cell instant to query it Only thing I can think of for the moment is to: 1. In your custom UITableViewCell subclass create a method that

UITableViewCell frame height not matching tableView:heightForRowAtIndexPath:

↘锁芯ラ 提交于 2019-11-29 14:14:53
I'm constructing a UITableView with variable height custom table cells, their height determined by the size of a contained multi-line UILabel. I've got the tableView:heightForRowAtIndexPath: delegate method wired up and calculating the final height correctly using sizeWithFont:constrainedToSize: . I've run across strange issue: by the time the data source method tableView:cellForRowAtIndexPath: is called, the correct per-row height has already been determined as described above, but the frame of the cell does not match that height. Instead, the frame.size.height property of the cell is the

how do I calculate heightForRowAtIndexPath when the cell is not even constructed yet?

主宰稳场 提交于 2019-11-28 21:42:53
问题 Question - How does one best calculate the height for a row in the "heightForRowAtIndexPath" method of a UITableViewController, given that: I'm using a custom subclassed UITableViewCell & the actually size of the subview (e.g. UILabels) is calculated at runtime & dependant on things such as if the user changed the font size the cell's aren't actually prepared it seems prior to a "heightForRowAtIndexPath", so you can't rely on calling your specific custom cell instant to query it Only thing I

heightForRowAtIndexPath being called for all rows & how many rows in a UITableView before performance issues?

别来无恙 提交于 2019-11-28 21:38:36
I thought I had read that for a UITableView that heightForRowAtIndexPath doesn't get called on all rows, but only on the ones that will be visible. This isn't what I'm seeing however. I'm seeing hundreds of calls to heightForRowAtIndexPath for the simple situation of the orientation being changed of the iPhone for example. So I'm assuming here therefore that for a UITableView with heightForRowAtIndexPath implemented, it does (i.e. heightForRowAtIndexPath ) get called for all rows (not just the visible ones)...let me know if this isn't quite correct. QUESTION: Given the above, how many rows in

UITableViewCell frame height not matching tableView:heightForRowAtIndexPath:

我们两清 提交于 2019-11-28 07:49:49
问题 I'm constructing a UITableView with variable height custom table cells, their height determined by the size of a contained multi-line UILabel. I've got the tableView:heightForRowAtIndexPath: delegate method wired up and calculating the final height correctly using sizeWithFont:constrainedToSize: . I've run across strange issue: by the time the data source method tableView:cellForRowAtIndexPath: is called, the correct per-row height has already been determined as described above, but the frame

iOS8 - constraints ambiguously suggest a height of zero

ぃ、小莉子 提交于 2019-11-27 11:24:11
Has anyone got any idea how to debug this? Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead. The rows have a fixed height as set by - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 34.0; } And all the constraints seem to be happy... FBronner Forcing a return height and estimated height made the warning disappear in my case. - (CGFloat)tableView:(UITableView *)tableView

iOS8 - constraints ambiguously suggest a height of zero

坚强是说给别人听的谎言 提交于 2019-11-26 15:33:38
问题 Has anyone got any idea how to debug this? Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view. We're considering the collapse unintentional and using standard height instead. The rows have a fixed height as set by - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 34.0; } And all the constraints seem to be happy... 回答1: Forcing a return height and estimated height