search

Home  >  Q&A  >  body text

Objective-c - Problem using scrollview in storyboard

Hello everyone, I want to make a page that exceeds one screen. I use scrollview on the storyboard. There is a tableview at the bottom of the scrollview. Now the height of the scrollview and tableview is uncertain, so I just added a fixed height constraint. I want to update the sizes of these two constraints in updateViewConstraints().
So far, it’s normal, but in the tableview, estimatedRowHeight is used to estimate height adaptively. The height of each cell is also normal, but when getting the height of all cells in the updateViewConstraints() method, the correct value cannot be obtained.
UITableViewCell *cell = [self tableView:self.commentTableView cellForRowAtIndexPath:indexPath];
height = cell.frame.size.height;

The value of height is incorrect! What are the problems with using it this way? Or is there a better way?
Thanks!

滿天的星座滿天的星座2811 days ago670

reply all(0)I'll reply

No reply
  • Cancelreply