本文整理汇总了C#中UITableView.ScrollRectToVisible方法的典型用法代码示例。如果您正苦于以下问题:C# UITableView.ScrollRectToVisible方法的具体用法?C# UITableView.ScrollRectToVisible怎么用?C# UITableView.ScrollRectToVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITableView
的用法示例。
在下文中一共展示了UITableView.ScrollRectToVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCell
public override UITableViewCell GetCell(UITableView tv)
{
var cell = tv.DequeueReusableCell(CustomInputCell.Key) as CustomInputCell;
if (cell == null)
{
cell = new CustomInputCell(_description);
cell.SelectionStyle = UITableViewCellSelectionStyle.None;
cell.TextView.Font = Font;
cell.TextView.InputAccessoryView = AccessoryView != null ? AccessoryView(cell.TextView) : new UIView();
cell.TextView.AutocorrectionType = SpellChecking ? UITextAutocorrectionType.Default : UITextAutocorrectionType.No;
cell.TextView.SpellCheckingType = SpellChecking ? UITextSpellCheckingType.Default : UITextSpellCheckingType.No;
cell.TextView.AutocapitalizationType = SpellChecking ? UITextAutocapitalizationType.Sentences : UITextAutocapitalizationType.None;
}
cell.HiddenSeperator = HiddenSeperator;
if (_textEditEnded != null)
_textEditEnded.Dispose();
_textEditEnded = Observable.FromEventPattern(x => cell.TextView.Ended += x, x => cell.TextView.Ended -= x)
.Subscribe(x => Value = cell.TextView.Text);
if (_textEditChanged != null)
_textEditChanged.Dispose();
_textEditChanged = Observable.FromEventPattern(x => cell.TextView.Changed += x, x => cell.TextView.Changed -= x)
.Subscribe(x =>
{
Value = cell.TextView.Text;
tv.BeginUpdates();
tv.EndUpdates();
var caret = cell.TextView.GetCaretRectForPosition(cell.TextView.SelectedTextRange.Start);
var cursorRect = tv.ConvertRectFromView(caret, cell.TextView);
var kk = cursorRect.Size;
kk.Height += 8.0f;
cursorRect.Size = kk;
tv.ScrollRectToVisible(cursorRect, false);
});
cell.TextView.Text = Value ?? string.Empty;
return cell;
}