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; } }
void ReleaseDesignerOutlets() { if (AnswerTextView != null) { AnswerTextView.Dispose(); AnswerTextView = null; } if (CommentLabel != null) { CommentLabel.Dispose(); CommentLabel = null; } if (CommentTextView != null) { CommentTextView.Dispose(); CommentTextView = null; } if (GuessedButton != null) { GuessedButton.Dispose(); GuessedButton = null; } if (NotGuessedButton != null) { NotGuessedButton.Dispose(); NotGuessedButton = null; } }
private void InitUI() { // Add tap to dismiss keyboard var tap = new UITapGestureRecognizer(() => CommentTextView.ResignFirstResponder()); tap.NumberOfTapsRequired = 1; View.AddGestureRecognizer(tap); // Set UI elements Title = ViewModel.Title; CommentTextView.Text = ViewModel.CommentPlaceholder; CommentTextView.TextContainer.LineFragmentPadding = 8; CommentTextView.TextContainerInset = new UIEdgeInsets(top: 3.7f, left: 0f, bottom: 2.3f, right: 0f); CommentTextView.BackgroundColor = ThemeManager.Instance.CurrentTheme.BackgroundColor.ToUIColor(); CommentTextView.Layer.CornerRadius = 5; }
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(); } ); }
void ReleaseDesignerOutlets() { if (AnswerButton != null) { AnswerButton.Dispose(); AnswerButton = null; } if (CommentTextView != null) { CommentTextView.Dispose(); CommentTextView = null; } if (QuestionTextView != null) { QuestionTextView.Dispose(); QuestionTextView = null; } if (RoundLabel != null) { RoundLabel.Dispose(); RoundLabel = null; } if (ScoreLabel != null) { ScoreLabel.Dispose(); ScoreLabel = null; } if (StartNewGameButton != null) { StartNewGameButton.Dispose(); StartNewGameButton = null; } }
private void OnRequestDismissKeyboard() { CommentTextView.ResignFirstResponder(); }