예제 #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            BubbleCell cell = null;
            Message    msg  = messages [indexPath.Row];

            cell         = (BubbleCell)tableView.DequeueReusableCell(GetReuseId(msg.Type));
            cell.Message = msg;

            return(cell);
        }
예제 #2
0
        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.Message = msg;

            cell.SetNeedsLayout();
            cell.LayoutIfNeeded();
            CGSize size = cell.ContentView.SystemLayoutSizeFittingSize(UIView.UILayoutFittingCompressedSize);

            return(NMath.Ceiling(size.Height) + 1);
        }