Tweak contact shares.

pull/1/head
Matthew Chen 7 years ago
parent 3c4d14034b
commit 2b457c6499

@ -11,7 +11,7 @@ extern const CGFloat kContactCellAvatarTextMargin;
@class SignalAccount;
@class TSThread;
@interface ContactCellView : UIView
@interface ContactCellView : UIStackView
@property (nonatomic, nullable) NSString *accessoryMessage;

@ -84,22 +84,12 @@ const CGFloat kContactCellAvatarTextMargin = 12;
[self.nameContainerView setContentHuggingHorizontalLow];
[self.accessoryViewContainer setContentHuggingHorizontalHigh];
UIStackView *hStackView = [[UIStackView alloc] initWithArrangedSubviews:@[
self.avatarView,
self.nameContainerView,
self.accessoryViewContainer,
]];
hStackView.axis = UILayoutConstraintAxisHorizontal;
hStackView.spacing = kContactCellAvatarTextMargin;
hStackView.distribution = UIStackViewDistributionFill;
[self addSubview:hStackView];
[hStackView autoVCenterInSuperview];
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeLeading];
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeTrailing];
// Ensure that the cell's contents never overflow the cell bounds.
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeTop relation:NSLayoutRelationGreaterThanOrEqual];
[hStackView autoPinEdgeToSuperviewMargin:ALEdgeBottom relation:NSLayoutRelationGreaterThanOrEqual];
self.axis = UILayoutConstraintAxisHorizontal;
self.spacing = kContactCellAvatarTextMargin;
self.alignment = UIStackViewAlignmentCenter;
[self addArrangedSubview:self.avatarView];
[self addArrangedSubview:self.nameContainerView];
[self addArrangedSubview:self.accessoryViewContainer];
[self configureFonts];
}

Loading…
Cancel
Save