Beispiel #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            //UITableViewCell cell = tableView.DequeueReusableCell(CellIndentifier);
            //string item = tableItems[indexPath.Row];

            //if (cell == null)
            //{
            //    //cell = new UITableViewCell(UITableViewCellStyle.Default, CellIndentifier);
            //    cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIndentifier);
            //    //cell = new UITableViewCell (UITableViewCellStyle.Value1, CellIndentifier);
            //    //cell = new UITableViewCell (UITableViewCellStyle.Value2, CellIndentifier);
            //}

            ////cell.TextLabel.Text = item;
            //cell.TextLabel.Text = tableItems[indexPath.Row];
            //cell.DetailTextLabel.Text = tableItems[indexPath.Row];
            //cell.ImageView.Image = indexPath.Row % 2 == 0 ? UIImage.FromFile("4.png") : UIImage.FromFile("3.png"); // don't use for Value2
            ////cell.TextLabel.Text = tableItems[indexPath.Row].Heading;
            ////cell.DetailTextLabel.Text = tableItems[indexPath.Row].SubHeading;
            ////cell.ImageView.Image = UIImage.FromFile("Images/" + tableItems[indexPath.Row].ImageName); // don't use for Value2

            ////cell.Accessory = UITableViewCellAccessory.Checkmark;
            ////cell.Accessory = UITableViewCellAccessory.DetailButton;
            ////cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            //cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; // implement AccessoryButtonTapped
            ////cell.Accessory = UITableViewCellAccessory.None; // to clear the accessory

            //return cell;

            var cell = tableView.DequeueReusableCell(cellIdentifier) as CustomVegeCell;

            if (cell == null)
            {
                cell = new CustomVegeCell(cellIdentifier);
            }
            cell.UpdateCell(tableItems[indexPath.Row]
                            , tableItems[indexPath.Row]
                            , UIImage.FromFile("4.png"));
            cell.SelectionStyle = UITableViewCellSelectionStyle.None;
            cell.SetNeedsUpdateConstraints();
            cell.UpdateConstraintsIfNeeded();
            return(cell);
        }
Beispiel #2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            //UITableViewCell cell = tableView.DequeueReusableCell(CellIndentifier);
            //string item = tableItems[indexPath.Row];

            //if (cell == null)
            //{
            //    //cell = new UITableViewCell(UITableViewCellStyle.Default, CellIndentifier);
            //    cell = new UITableViewCell(UITableViewCellStyle.Subtitle, CellIndentifier);
            //    //cell = new UITableViewCell (UITableViewCellStyle.Value1, CellIndentifier);
            //    //cell = new UITableViewCell (UITableViewCellStyle.Value2, CellIndentifier);
            //}

            ////cell.TextLabel.Text = item;
            //cell.TextLabel.Text = tableItems[indexPath.Row];
            //cell.DetailTextLabel.Text = tableItems[indexPath.Row];
            //cell.ImageView.Image = indexPath.Row % 2 == 0 ? UIImage.FromFile("4.png") : UIImage.FromFile("3.png"); // don't use for Value2
            ////cell.TextLabel.Text = tableItems[indexPath.Row].Heading;
            ////cell.DetailTextLabel.Text = tableItems[indexPath.Row].SubHeading;
            ////cell.ImageView.Image = UIImage.FromFile("Images/" + tableItems[indexPath.Row].ImageName); // don't use for Value2

            ////cell.Accessory = UITableViewCellAccessory.Checkmark;
            ////cell.Accessory = UITableViewCellAccessory.DetailButton;
            ////cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            //cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; // implement AccessoryButtonTapped
            ////cell.Accessory = UITableViewCellAccessory.None; // to clear the accessory

            //return cell;

            var cell = tableView.DequeueReusableCell(cellIdentifier) as CustomVegeCell;
            if (cell == null)
                cell = new CustomVegeCell(cellIdentifier);
            cell.UpdateCell(tableItems[indexPath.Row]
                    , tableItems[indexPath.Row]
                    , UIImage.FromFile("4.png"));
            cell.SelectionStyle = UITableViewCellSelectionStyle.None;
            cell.SetNeedsUpdateConstraints();
            cell.UpdateConstraintsIfNeeded();
            return cell;
        }