I have a problem with the vertical alignment of a UITextField in a TableView when using Dynamic Type to change the user-selected font sizes and weights.
Cause of my terrible English, I`ll use Screenshots: Upps, not enough reputations to post them. :-(
In my TableView with custom Cells I´m using Autolayout. But disabling Autolayout doesn´t matter for my problem. So I think this doesn´t cause it.
Everything looks fine.
When I change to "Settings" and select another the font size, after returning to the App, the UITextFields vertical Alignment had moved up by about 5 points, depending on the new Fontsize
When one [textField becomeFirstResponder]
, it moves into the correct position:
When I close the Form and open it again, everything is ok!!!
The source code:
in viewDidLoad
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(preferredContentSizeChanged:)
name:UIContentSizeCategoryDidChangeNotification
object:nil];
and
- (void)preferredContentSizeChanged:(NSNotification *)notification
{
[self.tableView reloadData];
}
- (void) configureFonts:(DetailColumnCell *)cell
{
cell.txtDetail.font = [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline];
}
Ok, a small problem, but so it doesn´t look professional ;-)
EDIT 1
There is a Label above the TextField. The Alignment of this Label keeps fine.
EDIT 2
When in the TableView are invisible cells at the bottom, I change the Font and scroll to this previously invisible cells, these cells are fine! Is the reuse of cells the matter? But I see no way to change this...