I have a dynamic UILabel in a TableHeaderView (see this question) and everything is okay and fine, but if I set the text of the label to nil
or @""
the label keeps the size of the height that it had when the text was in.
I'm changing the text in a different viewController that I'm presenting modally
. So i would like to show it you in 3 steps:
Original state
After setting the text to @""
In this step I presented the viewController to remove the text and then I dismiss the viewController to go back to this View.
Reappear this View
So I have to open the editing viewController to just dismiss it again. Then it is like i want it to..:
Any ideas why? I'm re-sizing the TableViewHeader like this in the viewWillAppear
method:
- (void)resizeTableViewHeader
{
//GET THE SIZE OF THE CONTAINER
CGSize fittingSize = [self.header systemLayoutSizeFittingSize: UILayoutFittingCompressedSize];
self.header.frame = CGRectMake(0, 0, 320, fittingSize.height);
self.tableView.tableHeaderView = self.header;
}
Any idea why I have to visit the View twice?