1
I’m trying to create a tableview with Cell dynamic according to the text inside it, and I’m trying to add the height of the label to the size of Cell but when I call the label in Viewconrtoller it’s empty and when I call in Tableviewcell it gives me the right size, how to pass (label.frame.size.height) from Tableviewcell to viewcontroller without losing its value.
Try this. <pre> -(Cgfloat)tableView:(Uitableview *)tableView heightForRowAtIndexPath: (Nsindexpath *)indexPath </pre>
– William Monteiro
I’m already using this method but I can’t pass the value of the label that is in my Tableviewcell to the viewcontroller
– Patrick Lopes
how you calculate cell phone size?
– William Monteiro
CGSize maximumLabelSize = CGSizeMake(296, FLT_MAX);
 
CGSize expectedLabelSize = [self.descriptin.text sizeWithFont:self.label.font constrainedToSize:maximumLabelSize lineBreakMode:self.label.lineBreakMode];
 
 CGRect newFrame = self.label.frame;
 newFrame.size.height = expectedLabelSize.height;
 self.label.frame = newFrame;

– Patrick Lopes
Dynamic Table View Cell Height and Auto Layout - http://www.raywenderlich.com/73602/dynamic-table-view-cell-height-auto-layout
– William Monteiro
This does not provide an answer to the question. To criticize or ask for clarification from an author, leave a comment below its publication - you can always comment on your own publications and when you have reputation points enough you will be able comment on any publication.
– Jorge B.
Publish the code you made so we can help you.
– Rafael Leão