diff options
author | Timur Bernikowich <bernikowich@outlook.com> | 2014-10-27 11:53:37 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:31:39 +0300 |
commit | 7720f8706e9b0df42778b2f4e7a7aa7247b6efa3 (patch) | |
tree | 5eba1732ae7cafd86a47e2daa181165a4c03033c /iphone/Maps/Classes/MapCell.mm | |
parent | 0ca8735f1799ea3259c95b205fbb4e9adb34f2da (diff) |
Improved separators presentation.
Diffstat (limited to 'iphone/Maps/Classes/MapCell.mm')
-rw-r--r-- | iphone/Maps/Classes/MapCell.mm | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/iphone/Maps/Classes/MapCell.mm b/iphone/Maps/Classes/MapCell.mm index 22b3430f9e..55a7e01a92 100644 --- a/iphone/Maps/Classes/MapCell.mm +++ b/iphone/Maps/Classes/MapCell.mm @@ -12,7 +12,10 @@ @property (nonatomic) UIImageView * arrowView; @property (nonatomic) BadgeView * badgeView; @property (nonatomic) UIImageView * routingImageView; -@property (nonatomic) UIImageView * separator; + +@property (nonatomic) UIView *separatorTop; +@property (nonatomic) UIView *separator; +@property (nonatomic) UIView *separatorBottom; @property (nonatomic, readonly) BOOL progressMode; @@ -24,7 +27,7 @@ { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; - NSArray * subviews = @[self.titleLabel, self.subtitleLabel, self.statusLabel, self.sizeLabel, self.progressView, self.arrowView, self.badgeView, self.routingImageView, self.separator]; + NSArray * subviews = @[self.titleLabel, self.subtitleLabel, self.statusLabel, self.sizeLabel, self.progressView, self.arrowView, self.badgeView, self.routingImageView, self.separator, self.separatorTop, self.separatorBottom]; for (UIView * subview in subviews) [self.contentView addSubview:subview]; @@ -162,6 +165,19 @@ self.routingImageView.center = CGPointMake(self.width - 25, self.height / 2 - 1); self.routingImageView.alpha = [self shouldShowRoutingView]; + + self.separatorTop.frame = CGRectMake(0, 0, self.width, PIXEL); + self.separatorTop.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin; + + self.separatorBottom.frame = CGRectMake(0, self.height - PIXEL, self.width, PIXEL); + self.separatorBottom.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleTopMargin; +} + +- (void)prepareForReuse +{ + self.separatorTop.hidden = YES; + self.separatorBottom.hidden = YES; + self.separator.hidden = NO; } - (void)layoutSubviews @@ -177,8 +193,8 @@ self.badgeView.minY = self.titleLabel.minY - 5; self.separator.minX = self.titleLabel.minX; - self.separator.size = CGSizeMake(self.width - 2 * self.separator.minX, 1); - self.separator.maxY = self.height + 0.5; + self.separator.size = CGSizeMake(self.width - 2 * self.separator.minX, PIXEL); + self.separator.maxY = self.height; } @@ -306,15 +322,34 @@ return _badgeView; } -- (UIImageView *)separator +- (UIView *)separatorTop +{ + if (!_separatorTop) + { + _separatorTop = [[UIView alloc] initWithFrame:CGRectZero]; + _separatorTop.backgroundColor = [UIColor colorWithColorCode:@"cecece"]; + } + return _separatorTop; +} + +- (UIView *)separator { if (!_separator) { - UIImage * separatorImage = [[UIImage imageNamed:@"MapCellSeparator"] resizableImageWithCapInsets:UIEdgeInsetsZero]; - _separator = [[UIImageView alloc] initWithFrame:CGRectZero]; - _separator.image = separatorImage; + _separator = [[UIView alloc] initWithFrame:CGRectZero]; + _separator.backgroundColor = [UIColor colorWithColorCode:@"cecece"]; } return _separator; } +- (UIView *)separatorBottom +{ + if (!_separatorBottom) + { + _separatorBottom = [[UIView alloc] initWithFrame:CGRectZero]; + _separatorBottom.backgroundColor = [UIColor colorWithColorCode:@"cecece"]; + } + return _separatorBottom; +} + @end |