From fa5897768305f4bd131d603b820f0d336c6bf1f7 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 19 Jun 2017 10:39:31 -0400 Subject: [PATCH] Prevent layout from jumping around in fingerprint view. // FREEBIE --- Signal/src/ViewControllers/FingerprintViewController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Signal/src/ViewControllers/FingerprintViewController.m b/Signal/src/ViewControllers/FingerprintViewController.m index 24375e5fe..299828cb6 100644 --- a/Signal/src/ViewControllers/FingerprintViewController.m +++ b/Signal/src/ViewControllers/FingerprintViewController.m @@ -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