forked from organicmaps/organicmaps
[ios] Fixed distance's layout in pp.
This commit is contained in:
parent
9fdcde875c
commit
9280f6a140
3 changed files with 11 additions and 4 deletions
|
@ -16,5 +16,6 @@
|
|||
- (void)removeBookmark;
|
||||
- (void)reloadBookmarkCell;
|
||||
- (void)updateAndLayoutMyPositionSpeedAndAltitude:(NSString *)text;
|
||||
- (void)setDistance:(NSString *)distance;
|
||||
|
||||
@end
|
||||
|
|
|
@ -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) +
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue