本文整理汇总了C#中UITableViewCell.SetNeedsLayout方法的典型用法代码示例。如果您正苦于以下问题:C# UITableViewCell.SetNeedsLayout方法的具体用法?C# UITableViewCell.SetNeedsLayout怎么用?C# UITableViewCell.SetNeedsLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UITableViewCell
的用法示例。
在下文中一共展示了UITableViewCell.SetNeedsLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public void Update(UITableView tableView, Cell cell, UITableViewCell nativeCell)
{
var parentListView = cell.RealParent as ListView;
var recycling = parentListView != null && parentListView.CachingStrategy == ListViewCachingStrategy.RecycleElement;
if (_cell != cell && recycling)
{
if (_cell != null)
((INotifyCollectionChanged)_cell.ContextActions).CollectionChanged -= OnContextItemsChanged;
((INotifyCollectionChanged)cell.ContextActions).CollectionChanged += OnContextItemsChanged;
}
var height = Frame.Height;
var width = tableView.Frame.Width;
nativeCell.Frame = new RectangleF(0, 0, width, height);
nativeCell.SetNeedsLayout();
var handler = new PropertyChangedEventHandler(OnMenuItemPropertyChanged);
_tableView = tableView;
SetupSelection(tableView);
if (_cell != null)
{
if (!recycling)
_cell.PropertyChanged -= OnCellPropertyChanged;
if (_menuItems.Count > 0)
{
if (!recycling)
((INotifyCollectionChanged)_cell.ContextActions).CollectionChanged -= OnContextItemsChanged;
foreach (var item in _menuItems)
item.PropertyChanged -= handler;
}
_menuItems.Clear();
}
_menuItems.AddRange(cell.ContextActions);
_cell = cell;
if (!recycling)
{
cell.PropertyChanged += OnCellPropertyChanged;
((INotifyCollectionChanged)_cell.ContextActions).CollectionChanged += OnContextItemsChanged;
}
var isOpen = false;
if (_scroller == null)
{
_scroller = new UIScrollView(new RectangleF(0, 0, width, height));
_scroller.ScrollsToTop = false;
_scroller.ShowsHorizontalScrollIndicator = false;
if (Forms.IsiOS8OrNewer)
_scroller.PreservesSuperviewLayoutMargins = true;
ContentView.AddSubview(_scroller);
}
else
{
_scroller.Frame = new RectangleF(0, 0, width, height);
isOpen = ScrollDelegate.IsOpen;
for (var i = 0; i < _buttons.Count; i++)
{
var b = _buttons[i];
b.RemoveFromSuperview();
b.Dispose();
}
_buttons.Clear();
ScrollDelegate.Unhook(_scroller);
ScrollDelegate.Dispose();
}
if (ContentCell != nativeCell)
{
if (ContentCell != null)
{
ContentCell.RemoveFromSuperview();
ContentCell = null;
}
ContentCell = nativeCell;
//Hack: if we have a ImageCell the insets are slightly different,
//the inset numbers user below were taken using the Reveal app from the default cells
if ((ContentCell as CellTableViewCell)?.Cell is ImageCell)
{
nfloat imageCellInsetLeft = 57;
nfloat imageCellInsetRight = 0;
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
{
imageCellInsetLeft = 89;
imageCellInsetRight = imageCellInsetLeft / 2;
}
//.........这里部分代码省略.........