diff options
author | v.mikhaylenko <v.mikhaylenko@corp.mail.ru> | 2015-06-29 17:17:31 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:53:16 +0300 |
commit | 1864e76a651a1e4a071da97b97445dc3458fde1e (patch) | |
tree | ed3b13c386f13589902c6726bd788845d6921c72 /iphone/Maps/Classes/MWMBookmarkColorViewController.mm | |
parent | 04c8abd86cf9cb723025709efa6ecae542b19f4c (diff) |
[ios] Fixes layout in place page and navigation bar.
Diffstat (limited to 'iphone/Maps/Classes/MWMBookmarkColorViewController.mm')
-rw-r--r-- | iphone/Maps/Classes/MWMBookmarkColorViewController.mm | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/iphone/Maps/Classes/MWMBookmarkColorViewController.mm b/iphone/Maps/Classes/MWMBookmarkColorViewController.mm index fa54c23d10..1543b0d37e 100644 --- a/iphone/Maps/Classes/MWMBookmarkColorViewController.mm +++ b/iphone/Maps/Classes/MWMBookmarkColorViewController.mm @@ -11,6 +11,7 @@ #import "MWMBookmarkColorCell.h" #import "MWMPlacePageEntity.h" #import "MWMPlacePageViewManager.h" +#import "UIViewController+navigation.h" extern NSArray * const kBookmarkColorsVariant; @@ -31,20 +32,9 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell"; - (void)viewDidLoad { [super viewDidLoad]; - [self.iPadOwnerNavigationController setNavigationBarHidden:NO]; self.title = L(@"bookmark_color"); [self.tableView registerNib:[UINib nibWithNibName:kBookmarkColorCellIdentifier bundle:nil] forCellReuseIdentifier:kBookmarkColorCellIdentifier]; self.colorWasChanged = NO; - if (!self.iPadOwnerNavigationController) - return; - - CGFloat const bottomOffset = 88.; - self.iPadOwnerNavigationController.view.height = self.tableView.height + bottomOffset; - UIImage * backImage = [UIImage imageNamed:@"NavigationBarBackButton"]; - UIButton * backButton = [[UIButton alloc] initWithFrame:CGRectMake(0., 0., backImage.size.width, backImage.size.height)]; - [backButton addTarget:self action:@selector(backTap) forControlEvents:UIControlEventTouchUpInside]; - [backButton setImage:backImage forState:UIControlStateNormal]; - [self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithCustomView:backButton]]; } - (void)viewWillAppear:(BOOL)animated @@ -52,10 +42,20 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell"; [super viewWillAppear:animated]; [self configureTableViewForOrientation:self.interfaceOrientation]; [self.tableView reloadData]; + if (!self.iPadOwnerNavigationController) + return; + + [self.iPadOwnerNavigationController setNavigationBarHidden:NO]; + CGFloat const bottomOffset = 88.; + self.iPadOwnerNavigationController.view.height = self.tableView.height + bottomOffset; + [self showBackButton]; } - (void)backTap { + if (self.iPadOwnerNavigationController) + [self.iPadOwnerNavigationController setNavigationBarHidden:YES]; + [self.navigationController popViewControllerAnimated:YES]; } @@ -113,8 +113,6 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell"; [super viewWillDisappear:animated]; if (self.colorWasChanged && !self.iPadOwnerNavigationController) [self.placePageManager reloadBookmark]; - else - self.iPadOwnerNavigationController.navigationBar.hidden = YES; } @end |