示例#1
0
        public void WillDisplayCell(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
        {
            if (m_isInModeCompare && Cyclers[(int)indexPath.Item].Origin == TeamOrigin.Mine)
            {
                (cell as CyclerTableCell).SetVisualsToOutsideRight(TeamCyclersTable.Bounds.Width);
                cell.LayoutIfNeeded();

                (cell as CyclerTableCell).SetVisualsToMine();

                UIView.Animate(1, () => {
                    cell.LayoutIfNeeded();
                });
            }
        }
示例#2
0
        private static void BindCell(UITableView tableView, UITableViewCell cell, object item)
        {
            if (cell is IMvxBindable bindable)
            {
                var bindingContext = bindable.BindingContext as MvxTaskBasedBindingContext;

                var isTaskBasedBindingContextAndHasAutomaticDimension =
                    bindingContext != null && tableView.RowHeight == UITableView.AutomaticDimension;

                // RunSynchronously must be called before DataContext is set
                if (isTaskBasedBindingContextAndHasAutomaticDimension)
                {
                    bindingContext.RunSynchronously = true;
                }

                bindable.DataContext = item;

                // If AutomaticDimension is used, xib based cells need to re-layout everything after bindings are applied
                // otherwise the cell height will be wrong
                if (isTaskBasedBindingContextAndHasAutomaticDimension)
                {
                    cell.LayoutIfNeeded();
                }
            }
        }
示例#3
0
        private nfloat CalculateHeight(UITableViewCell cell)
        {
            cell.SetNeedsLayout();
            cell.LayoutIfNeeded();

            var size = cell.ContentView.Frame.Size;

            return(NMath.Ceiling(size.Height) + 1);
        }
示例#4
0
        public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(CellIdentifier);

            cell = tableView.DequeueReusableCell(CellIdentifier);
            cell = new UITableViewCell(UITableViewCellStyle.Default, CellIdentifier);

            // Configure the cell
            cell.TextLabel.Text = _storeList[indexPath.Row].Store;

            // Layout the cell
            cell.LayoutIfNeeded();

            // Get the height for the cell
            var height = cell.ContentView.SystemLayoutSizeFittingSize(UIView.UILayoutFittingCompressedSize).Height;

            // Padding for cell ceparator
            return(height + 15);
        }
        public override nfloat GetHeightForRow(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(CellIdentifier);

            cell = tableView.DequeueReusableCell(CellIdentifier);
            cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIdentifier);

            // Configure the cell
            cell.DetailTextLabel.TextColor = UIColor.Black;
            cell.TextLabel.Text            = _consumeList[indexPath.Row].Store;
            cell.DetailTextLabel.Text      = _consumeList[indexPath.Row].Amount.ToString() + " €"
                                             + " / " + string.Format("{0:0.00}", _consumeList[indexPath.Row].Date);

            // Layout the cell
            cell.LayoutIfNeeded();

            // Get the height for the cell
            var height = cell.ContentView.SystemLayoutSizeFittingSize(UIView.UILayoutFittingCompressedSize).Height;

            // Padding for cell ceparator
            return(height + 15);
        }