本文整理汇总了C#中UITextView.GetCaretRectForPosition方法的典型用法代码示例。如果您正苦于以下问题:C# UITextView.GetCaretRectForPosition方法的具体用法?C# UITextView.GetCaretRectForPosition怎么用?C# UITextView.GetCaretRectForPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITextView
的用法示例。
在下文中一共展示了UITextView.GetCaretRectForPosition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdjustTextViewSelection
private void AdjustTextViewSelection(UITextView textView)
{
// Ensure that the text view is visible by making the text view frame smaller as text can be slightly cropped at the bottom.
// Note that this is a workwaround to a bug in iOS.
textView.LayoutIfNeeded ();
var caretRect = textView.GetCaretRectForPosition (textView.SelectedTextRange.End);
caretRect.Height += textView.TextContainerInset.Bottom;
textView.ScrollRectToVisible (caretRect, animated: false);
}
示例2: scrollToCursorForTextView
private void scrollToCursorForTextView(UITextView textView)
{
CoreGraphics.CGRect cursorRect = textView.GetCaretRectForPosition (textView.SelectedTextRange.Start);
cursorRect = this._tableView.ConvertRectFromView (cursorRect, textView);
if(this.rectVisible(cursorRect))
{
CoreGraphics.CGSize tempSize = cursorRect.Size;
tempSize.Height += 8;
cursorRect.Size = tempSize;
this._tableView.ScrollRectToVisible (cursorRect, true);
}
}