From 294fc822fdd11b195b1982fffe53c8a2f1919c75 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Wed, 18 Oct 2017 21:18:19 -0700 Subject: [PATCH] Fixing feed detail view for iPhone X. --- .../ios/Classes/FeedDetailViewController.m | 23 ++++++- clients/ios/Classes/NewsBlurViewController.m | 2 + .../FeedDetailViewController.xib | 68 ++++++++++++------- 3 files changed, 68 insertions(+), 25 deletions(-) diff --git a/clients/ios/Classes/FeedDetailViewController.m b/clients/ios/Classes/FeedDetailViewController.m index 6401e9a3f..4a9fc49f7 100644 --- a/clients/ios/Classes/FeedDetailViewController.m +++ b/clients/ios/Classes/FeedDetailViewController.m @@ -86,7 +86,8 @@ self.storyTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4); self.storyTitlesTable.separatorColor = UIColorFromRGB(0xE9E8E4); - + self.view.backgroundColor = UIColorFromRGB(0xf4f4f4); + spacerBarButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; spacerBarButton.width = 0; @@ -1215,10 +1216,27 @@ height = height - kTableViewShortRowDifference; } - fleuron.frame = CGRectMake(0, 0, self.view.frame.size.width, height); + fleuron.translatesAutoresizingMaskIntoConstraints = NO; fleuron.contentMode = UIViewContentModeCenter; fleuron.tag = 99; [cell.contentView addSubview:fleuron]; + [cell.contentView addConstraint:[NSLayoutConstraint constraintWithItem:fleuron + attribute:NSLayoutAttributeHeight + relatedBy:NSLayoutRelationEqual toItem:nil + attribute:NSLayoutAttributeNotAnAttribute + multiplier:1.0 constant:height]]; + [cell.contentView addConstraint:[NSLayoutConstraint constraintWithItem:fleuron + attribute:NSLayoutAttributeCenterX + relatedBy:NSLayoutRelationEqual + toItem:cell.contentView + attribute:NSLayoutAttributeCenterX + multiplier:1.0 constant:0]]; + [cell.contentView addConstraint:[NSLayoutConstraint constraintWithItem:fleuron + attribute:NSLayoutAttributeCenterY + relatedBy:NSLayoutRelationEqual + toItem:cell.contentView + attribute:NSLayoutAttributeCenterY + multiplier:1.0 constant:0]]; cell.backgroundColor = [UIColor clearColor]; return cell; } else {//if ([appDelegate.storyLocationsCount]) { @@ -2159,6 +2177,7 @@ didEndSwipingSwipingWithState:(MCSwipeTableViewCellState)state self.searchBar.keyboardAppearance = UIKeyboardAppearanceDefault; } + self.view.backgroundColor = UIColorFromRGB(0xf4f4f4); self.storyTitlesTable.backgroundColor = UIColorFromRGB(0xf4f4f4); self.storyTitlesTable.separatorColor = UIColorFromRGB(0xE9E8E4); [self.storyTitlesTable reloadData]; diff --git a/clients/ios/Classes/NewsBlurViewController.m b/clients/ios/Classes/NewsBlurViewController.m index c7b97adad..366b0697a 100644 --- a/clients/ios/Classes/NewsBlurViewController.m +++ b/clients/ios/Classes/NewsBlurViewController.m @@ -137,6 +137,7 @@ static UIFont *userLabelFont; [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: UIColorFromFixedRGB(0x4C4D4A)} forState:UIControlStateHighlighted]; + self.view.backgroundColor = UIColorFromRGB(0xf4f4f4); self.navigationController.navigationBar.tintColor = UIColorFromRGB(0x8F918B); self.navigationController.navigationBar.translucent = NO; UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; @@ -955,6 +956,7 @@ static UIFont *userLabelFont; self.settingsBarButton.tintColor = UIColorFromRGB(0x8F918B); self.refreshControl.tintColor = UIColorFromLightDarkRGB(0x0, 0xffffff); self.refreshControl.backgroundColor = UIColorFromRGB(0xE3E6E0); + self.view.backgroundColor = UIColorFromRGB(0xf4f4f4); NBBarButtonItem *barButton = self.addBarButton.customView; [barButton setImage:[[ThemeManager themeManager] themedImage:[UIImage imageNamed:@"nav_icn_add.png"]] forState:UIControlStateNormal]; diff --git a/clients/ios/Resources-iPhone/FeedDetailViewController.xib b/clients/ios/Resources-iPhone/FeedDetailViewController.xib index 0f3afc924..6ba2979c0 100644 --- a/clients/ios/Resources-iPhone/FeedDetailViewController.xib +++ b/clients/ios/Resources-iPhone/FeedDetailViewController.xib @@ -1,8 +1,15 @@ - - + + + + + - + + + + + @@ -18,43 +25,58 @@ - + - - - + - - - + + + + + + + + + + +