public static class UITextViewExtenstions
{
public static void AppendTextLine(this UITextView textView, string text)
{
textView.Text += string.Format ("\r\n{0}", text);
textView.ScrollToBottom ();
}
public static void ScrollToBottom(this UITextViewExtenstions txtView)
{
textView.ScrollRangeToVisible (new NSRange (txtView.Text.Length - 1, 1));
}
}
调用:
loggingView.AppendTextLine ("xxxxxxx");