Created
February 2, 2016 20:57
-
-
Save thornpig/215990f2f3f4349f41f1 to your computer and use it in GitHub Desktop.
Force early layout with layoutIfNeeded if the some frame information is needed before the drawing cycle begins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)viewWillAppear:(BOOL)animated | |
{ | |
//force the layout before the drawing cycle begins, so that when the tableview setup its cells the subviews of the cell | |
already have the frame information of the cell. For example, with this line, the text view inside the cell can use | |
the cell width to calculate depth to accormodate its text. | |
[self.view layoutIfNeeded]; | |
[self.tableView reloadData]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment