I have a UITableView with a custom UITableViewCell. In cellForRowAtIndexPath, I assign a font to a label in every cell, since the user can change font size at any time. To cha
I'm curious, how do you display your settings screen? viewWillAppear
should be called under normal circumstances when returning. Do you use
[self presentModelViewController:animated:]
or
[self.navigationController pushViewController:animated:]
These should both work. If, on the other hand, you're just adding the settings view as a subview of the window or current view or something, then removing it won't call viewWillAppear
on the table view controller.
So if you're not using one of those two methods, do. If you already are, then setting the font of the cell is really as simple as getting the cell and setting its font. If you're using a standard UITableViewCell
, that's done with
cell.font = newFont;
If you're using a custom subclass, I obviously can't tell you exactly how it needs to work, but the way Nikolai has it is correct.
For the cells that are still there you have to update the font of the label. You'll need a way to access the custom label in your custom cell.
After changing the font size do something like:
for (MyCell* cell in [theTableView visibleCells]) {
[cell.myLabel.font = newFont];
}
In your custom UITableViewCell, call [self setNeedsLayout];
and it should repaint your cell at the next loop. I use it for asynchronous image loading since I'm pulling the image from the Web and it works swell.