mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
iOS: Fix height of font settings and font list, removing extra separators/space.
Lets the menu table views do their own height calculations and makes the bottom vertical inset match the top (negative) to avoid extra white space at the bottom of the popover. The preferredContentSize of FontSettingsViewController was previously hard-coded to account for a navigation bar which was subsequently hidden, which could sometimes result in a too-small popover if the navigation bar was already hidden; hide it explicitly instead and remove this workaround.
This commit is contained in:
parent
05b54f1227
commit
d6b2c9cd15
2 changed files with 15 additions and 2 deletions
|
@ -24,14 +24,25 @@
|
|||
|
||||
self.fontTableView.backgroundColor = UIColorFromRGB(0xECEEEA);
|
||||
self.fontTableView.separatorColor = UIColorFromRGB(0x909090);
|
||||
|
||||
// eliminate extra separators at bottom of menu, if any
|
||||
self.fontTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
self.title = @"Font";
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated {
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
CGSize contentSize = self.fontTableView.contentSize;
|
||||
contentSize.height += self.fontTableView.frame.origin.y * 2;
|
||||
|
||||
self.preferredContentSize = CGSizeMake(240.0, 38.0 * self.fonts.count);
|
||||
self.navigationController.preferredContentSize = contentSize;
|
||||
self.fontTableView.scrollEnabled = contentSize.height > self.view.frame.size.height;
|
||||
}
|
||||
|
||||
#pragma mark - Table view data source
|
||||
|
|
|
@ -108,7 +108,9 @@
|
|||
|
||||
[self.menuTableView reloadData];
|
||||
|
||||
self.preferredContentSize = CGSizeMake(240.0, 296.0);
|
||||
// -[NewsBlurAppDelegate navigationController:willShowViewController:animated:] hides this too late, so this gets mis-measured otherwise
|
||||
self.navigationController.navigationBarHidden = YES;
|
||||
self.navigationController.preferredContentSize = CGSizeMake(240.0, self.menuTableView.contentSize.height + (self.menuTableView.frame.origin.y * 2));
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
|
|
Loading…
Add table
Reference in a new issue