public override float GetHeightForRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (_usedForHeight == null) { _usedForHeight = (FeedbackCellView)tableView.DequeueReusableCell(FeedbackCellView.Key); } var item = ItemAt(indexPath) as FeedbackItemViewModel; if (item != null) { _usedForHeight.ViewModel = item; _usedForHeight.SetNeedsUpdateConstraints(); _usedForHeight.UpdateConstraintsIfNeeded(); _usedForHeight.Bounds = new System.Drawing.RectangleF(0, 0, tableView.Bounds.Width, tableView.Bounds.Height); _usedForHeight.SetNeedsLayout(); _usedForHeight.LayoutIfNeeded(); return(_usedForHeight.ContentView.SystemLayoutSizeFittingSize(MonoTouch.UIKit.UIView.UILayoutFittingCompressedSize).Height + 1); } return(base.GetHeightForRow(tableView, indexPath)); }
public FeedbackTableViewSource(UITableView tableView, IReactiveNotifyCollectionChanged <FeedbackItemViewModel> collection) : base(tableView, collection, FeedbackCellView.Key, 69.0f) { _cache = new TableViewCellHeightCache <FeedbackCellView, FeedbackItemViewModel>(69.0f, () => FeedbackCellView.Create(true)); tableView.RegisterNibForCellReuse(FeedbackCellView.Nib, FeedbackCellView.Key); }