Prevent layout from jumping around in fingerprint view.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-06-19 10:39:31 -04:00
parent 8b06a007bf
commit fa58977683
1 changed files with 6 additions and 0 deletions

View File

@ -320,6 +320,12 @@ typedef void (^CustomLayoutBlock)();
verificationStateLabel.lineBreakMode = NSLineBreakByWordWrapping;
[self.view addSubview:verificationStateLabel];
[verificationStateLabel autoPinWidthToSuperviewWithMargin:16.f];
// Bind height of label to height of two lines of text.
// This should always be sufficient, and will prevent the view's
// layout from changing if the user is marked as verified or not
// verified.
[verificationStateLabel autoSetDimension:ALDimensionHeight
toSize:round(verificationStateLabel.font.lineHeight * 2.25f)];
[verificationStateLabel autoPinToTopLayoutGuideOfViewController:self withInset:ScaleFromIPhone5To7Plus(15.f, 20.f)];
[verificationStateLabel autoPinEdge:ALEdgeBottom
toEdge:ALEdgeTop