[ios] Fixed distance's layout in pp.

This commit is contained in:
VladiMihaylenko 2016-03-25 20:08:24 +03:00
parent 9fdcde875c
commit 9280f6a140
3 changed files with 11 additions and 4 deletions

View file

@ -16,5 +16,6 @@
- (void)removeBookmark;
- (void)reloadBookmarkCell;
- (void)updateAndLayoutMyPositionSpeedAndAltitude:(NSString *)text;
- (void)setDistance:(NSString *)distance;
@end

View file

@ -236,11 +236,18 @@ enum class AttributePosition
}
}
- (void)setDistance:(NSString *)distance
{
self.distanceLabel.text = distance;
self.distanceLabel.width = placePageWidth() - kLabelsPadding;
[self.distanceLabel sizeToFit];
[self layoutDistanceBoxWithPosition:[self distanceAttributePosition]];
[self layoutIfNeeded];
}
- (void)layoutSubviews
{
[super layoutSubviews];
self.distanceLabel.width = placePageWidth() - kLabelsPadding;
[self.distanceLabel sizeToFit];
CGFloat const bound = self.distanceLabel.width + kDirectionArrowSide + kOffsetFromDistanceToArrow + kOffsetFromTitleToDistance;
AttributePosition const position = [self distanceAttributePosition];
[self setupLabelsWidthWithBoundedWidth:bound distancePosition:position];
@ -248,7 +255,6 @@ enum class AttributePosition
[self.typeLabel sizeToFit];
[self.addressLabel sizeToFit];
[self layoutLabels];
[self layoutDistanceBoxWithPosition:position];
[self layoutTableViewWithPosition:position];
self.height = self.featureTable.height + self.separatorView.height + self.titleLabel.height +
(self.typeLabel.text.length > 0 ? self.typeLabel.height + kLabelsBetweenOffset : 0) +

View file

@ -172,7 +172,7 @@ static NSString * const kPlacePageViewCenterKeyPath = @"center";
- (void)setDistance:(NSString *)distance
{
self.basePlacePageView.distanceLabel.text = distance;
self.basePlacePageView.distance = distance;
}
- (void)updateMyPositionStatus:(NSString *)status