예제 #1
0
        void ReleaseDesignerOutlets()
        {
            if (CommentContainerView != null)
            {
                CommentContainerView.Dispose();
                CommentContainerView = null;
            }

            if (CommentContainerViewBottomConstraint != null)
            {
                CommentContainerViewBottomConstraint.Dispose();
                CommentContainerViewBottomConstraint = null;
            }

            if (CommentTextView != null)
            {
                CommentTextView.Dispose();
                CommentTextView = null;
            }

            if (ReplyButton != null)
            {
                ReplyButton.Dispose();
                ReplyButton = null;
            }

            if (CommentTextViewHeightConstraint != null)
            {
                CommentTextViewHeightConstraint.Dispose();
                CommentTextViewHeightConstraint = null;
            }
        }
예제 #2
0
        private void KeyboardWillChange(nfloat bottom, NSNotification notification)
        {
            var duration = UIKeyboard.AnimationDurationFromNotification(notification);

            CommentContainerView.SetNeedsLayout();

            CommentContainerViewBottomConstraint.Constant = bottom;

            UIView.Animate(
                duration: duration,
                animation: CommentContainerView.LayoutIfNeeded
                );
        }
예제 #3
0
        private void OnCommentTextViewChanged(object sender, EventArgs args)
        {
            // Set bounds for text
            var height = CommentTextView.SizeThatFits(new CGSize(CommentTextView.Frame.Width, nfloat.MaxValue)).Height;

            height = height > 100 ? 100 : height;
            height = height < 24 ? 24 : height;

            CommentTextView.SetNeedsLayout();

            CommentTextViewHeightConstraint.Constant = height;

            UIView.Animate(
                duration: 0.25,
                animation: () => {
                CommentTextView.LayoutIfNeeded();
                CommentContainerView.LayoutIfNeeded();
            }
                );
        }