void ReleaseDesignerOutlets() { if (BoyButton != null) { BoyButton.Dispose(); BoyButton = null; } if (BubbleImg != null) { BubbleImg.Dispose(); BubbleImg = null; } if (BubbleImgTopOffset != null) { BubbleImgTopOffset.Dispose(); BubbleImgTopOffset = null; } if (ContinueBtn != null) { ContinueBtn.Dispose(); ContinueBtn = null; } if (GirlButton != null) { GirlButton.Dispose(); GirlButton = null; } if (Input != null) { Input.Dispose(); Input = null; } if (NavBarBlendView != null) { NavBarBlendView.Dispose(); NavBarBlendView = null; } if (NavBarBlendViewHeightConstraint != null) { NavBarBlendViewHeightConstraint.Dispose(); NavBarBlendViewHeightConstraint = null; } if (NickName != null) { NickName.Dispose(); NickName = null; } if (SwitchSignUpType != null) { SwitchSignUpType.Dispose(); SwitchSignUpType = null; } if (ThemeSelectorContainerView != null) { ThemeSelectorContainerView.Dispose(); ThemeSelectorContainerView = null; } }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); var ratio = NavBarBlendView.Bounds.Height / blendViewNormalHeight; if (ratio < 1) { if (bubbleWidhtConstraint != null || bubbleHeightConstraint != null) { return; } bubbleWidhtConstraint = SetConstant(BubbleImg, NSLayoutAttribute.Width, ratio * BubbleImg.IntrinsicContentSize.Width); bubbleHeightConstraint = SetConstant(BubbleImg, NSLayoutAttribute.Height, ratio * BubbleImg.IntrinsicContentSize.Height); bubbleTopNormalOffset = BubbleImgTopOffset.Constant; BubbleImgTopOffset.Constant -= (blendViewNormalHeight - BubbleImg.IntrinsicContentSize.Height) * (1 - ratio) / 2; BubbleImgTopOffset.Constant = NMath.Max(BubbleImgTopOffset.Constant, 0); } else { if (bubbleWidhtConstraint == null || bubbleHeightConstraint == null) { return; } BubbleImg.RemoveConstraint(bubbleWidhtConstraint); BubbleImg.RemoveConstraint(bubbleHeightConstraint); bubbleWidhtConstraint = bubbleHeightConstraint = null; BubbleImgTopOffset.Constant = bubbleTopNormalOffset; } View.LayoutIfNeeded(); }