diff --git a/iphone/Maps/Classes/MWMBookmarkColorCell.mm b/iphone/Maps/Classes/MWMBookmarkColorCell.mm index 016c1f424e..b3314c8e45 100644 --- a/iphone/Maps/Classes/MWMBookmarkColorCell.mm +++ b/iphone/Maps/Classes/MWMBookmarkColorCell.mm @@ -21,11 +21,8 @@ extern NSArray * const kBookmarkColorsVariant; - (void)configureWithColorString:(NSString *)colorString { - CGFloat const leftOffset = 60.; - CGFloat const rightOffset = 42.; self.currentImageName = colorString; self.titleLabel.text = L([colorString stringByReplacingOccurrencesOfString:@"placemark-" withString:@""]); - self.titleLabel.width = self.bounds.size.width - leftOffset - rightOffset; } - (void)setSelected:(BOOL)selected animated:(BOOL)animated diff --git a/iphone/Maps/Classes/MWMBookmarkColorCell.xib b/iphone/Maps/Classes/MWMBookmarkColorCell.xib index 516007831b..5947ec4aab 100644 --- a/iphone/Maps/Classes/MWMBookmarkColorCell.xib +++ b/iphone/Maps/Classes/MWMBookmarkColorCell.xib @@ -1,8 +1,9 @@ - + - + + @@ -14,25 +15,42 @@ - + + + + + + + + + diff --git a/iphone/Maps/Classes/MWMBookmarkColorViewController.mm b/iphone/Maps/Classes/MWMBookmarkColorViewController.mm index 1543b0d37e..be0cb0e811 100644 --- a/iphone/Maps/Classes/MWMBookmarkColorViewController.mm +++ b/iphone/Maps/Classes/MWMBookmarkColorViewController.mm @@ -21,6 +21,7 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell"; @property (weak, nonatomic) IBOutlet UITableView * tableView; @property (nonatomic) BOOL colorWasChanged; +@property (weak, nonatomic) IBOutlet NSLayoutConstraint * tableViewHeight; @end @@ -64,38 +65,25 @@ static NSString * const kBookmarkColorCellIdentifier = @"MWMBookmarkColorCell"; if (self.iPadOwnerNavigationController) return; - CGFloat const defaultHeight = 352.; CGSize const size = self.navigationController.view.bounds.size; - CGFloat const topOffset = 24.; - + CGFloat const defaultHeight = 352.; switch (orientation) { - case UIInterfaceOrientationUnknown: - break; - - case UIInterfaceOrientationPortraitUpsideDown: case UIInterfaceOrientationPortrait: - { - CGFloat const width = MIN(size.width, size.height); - CGFloat const height = MAX(size.width, size.height); - CGFloat const externalHeight = self.navigationController.navigationBar.height + [[UIApplication sharedApplication] statusBarFrame].size.height; - CGFloat const actualHeight = defaultHeight > (height - externalHeight) ? height : defaultHeight; - self.tableView.frame = CGRectMake(0., topOffset, width, actualHeight); + case UIInterfaceOrientationPortraitUpsideDown: + case UIInterfaceOrientationUnknown: + self.tableViewHeight.constant = defaultHeight; break; - } - case UIInterfaceOrientationLandscapeLeft: case UIInterfaceOrientationLandscapeRight: { - CGFloat const navBarHeight = self.navigationController.navigationBar.height + [UIApplication sharedApplication].statusBarFrame.size.height; - CGFloat const width = MAX(size.width, size.height); - CGFloat const height = MIN(size.width, size.height); - CGFloat const currentHeight = height - navBarHeight - 2 * topOffset; - CGFloat const actualHeight = currentHeight > defaultHeight ? defaultHeight : currentHeight; - self.tableView.frame = CGRectMake(0., topOffset, width, actualHeight); + CGFloat const topOffset = 24.; + CGFloat const navBarHeight = 64.; + self.tableViewHeight.constant = MIN(defaultHeight, MIN(size.width, size.height) - 2 * topOffset - navBarHeight); break; } } + [self.tableView setNeedsLayout]; } - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation diff --git a/iphone/Maps/Classes/MWMBookmarkColorViewController.xib b/iphone/Maps/Classes/MWMBookmarkColorViewController.xib index 8617be5549..9bfc3ed1cd 100644 --- a/iphone/Maps/Classes/MWMBookmarkColorViewController.xib +++ b/iphone/Maps/Classes/MWMBookmarkColorViewController.xib @@ -1,13 +1,14 @@ - + - - + + + @@ -16,10 +17,12 @@ - + - + + + @@ -28,6 +31,11 @@ + + + + + diff --git a/iphone/Maps/Classes/MWMDirectionView.xib b/iphone/Maps/Classes/MWMDirectionView.xib index f41da15607..28eb299451 100644 --- a/iphone/Maps/Classes/MWMDirectionView.xib +++ b/iphone/Maps/Classes/MWMDirectionView.xib @@ -1,5 +1,5 @@ - +