Fix the input toolbar border.

This commit is contained in:
Matthew Chen 2019-02-01 17:00:37 -05:00
parent 0a522b8f06
commit dd506430d9
1 changed files with 17 additions and 2 deletions

View File

@ -196,8 +196,6 @@ const CGFloat kMaxTextViewHeight = 98;
const CGFloat vStackRounding = 18.f;
UIView *vStackWrapper = [UIView containerView];
vStackWrapper.layer.cornerRadius = vStackRounding;
vStackWrapper.layer.borderColor = Theme.secondaryColor.CGColor;
vStackWrapper.layer.borderWidth = CGHairlineWidth();
vStackWrapper.clipsToBounds = YES;
[vStackWrapper addSubview:vStack];
[vStack ows_autoPinToSuperviewEdges];
@ -231,6 +229,23 @@ const CGFloat kMaxTextViewHeight = 98;
self.hStack.preservesSuperviewLayoutMargins = NO;
self.preservesSuperviewLayoutMargins = NO;
// Border
//
// The border must reside _outside_ of vStackWrapper so
// that it doesn't run afoul of its clipping, so we can't
// use addBorderViewWithColor.
UIView *borderView = [UIView new];
borderView.userInteractionEnabled = NO;
borderView.backgroundColor = UIColor.clearColor;
borderView.opaque = NO;
borderView.layer.borderColor = Theme.secondaryColor.CGColor;
borderView.layer.borderWidth = CGHairlineWidth();
borderView.layer.cornerRadius = vStackRounding;
[self addSubview:borderView];
[borderView autoPinToEdgesOfView:vStackWrapper];
[borderView setCompressionResistanceLow];
[borderView setContentHuggingLow];
[self ensureShouldShowVoiceMemoButtonAnimated:NO doLayout:NO];
}