public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { BubbleCell cell = null; Message msg = messages[indexPath.Row]; cell = (BubbleCell)tableView.DequeueReusableCell(GetReuseId(msg.Type)); cell.vcpadre = vcontroller; cell.Message = msg; return(cell); }
nfloat CalculateHeightFor(Message msg, UITableView tableView) { var index = (int)msg.Type; BubbleCell cell = sizingCells[index]; if (cell == null) { cell = sizingCells[index] = (BubbleCell)tableView.DequeueReusableCell(GetReuseId(msg.Type)); cell.vcpadre = vcontroller; } cell.Message = msg; cell.SetNeedsLayout(); cell.LayoutIfNeeded(); CGSize size = cell.ContentView.SystemLayoutSizeFittingSize(UIView.UILayoutFittingCompressedSize); return(NMath.Ceiling(size.Height) + 1); }