Пример #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            RowModel currentModel = sections[indexPath.Section].Rows[indexPath.Row];

            UITableViewCell cell = tableView.DequeueReusableCell("cell") ??
                                   new UITableViewCell(UITableViewCellStyle.Subtitle, "Cell");

            switch (currentModel.CellAccessory)
            {
            case UITableViewCellAccessory.Checkmark:
                cell.Accessory = currentModel.IsChecked ? currentModel.CellAccessory : UITableViewCellAccessory.None;
                break;

            default:
                cell.Accessory = currentModel.CellAccessory;
                break;
            }

            cell.Tag            = indexPath.Row;
            cell.TextLabel.Text = currentModel.Name;
            cell.AccessoryView  = currentModel.AccessoryView;

            if (currentModel.CustomUI != null)
            {
                currentModel.CustomUI.Frame = currentModel.CustomUIBounds;
                cell.Add(currentModel.CustomUI);
            }

            return(cell);
        }
Пример #2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            UITableViewCell cell = new UITableViewCell();

            //if (temp[Convert.ToInt32(indexPath)] != null)
            {
                cell.Add(GetViewForSKUCell(indexPath.Item));
                //temp[Convert.ToInt32(indexPath)] = cell;
            }
            return(cell);
        }
		public override UITableViewCell GetCell (UITableView tv)
		{
			var cell = tv.DequeueReusableCell (ikey);
			if (cell == null){
				cell = new UITableViewCell (UITableViewCellStyle.Default, ikey);
				cell.Add(Image);
			}
			
			if (tv.Style == UITableViewStyle.Grouped){
				cell.BackgroundColor = UIColor.Clear;
				cell.BackgroundView = new UIView{BackgroundColor = UIColor.Clear, Frame = new RectangleF(0,0,0,0)};
			}
			Image.Image = Value;
			cell.UserInteractionEnabled =false;
			return cell;
		}
Пример #4
0
        protected override UITableViewCell GetCellImpl(UITableView tv)
        {
            if (cellImg == null)
            {
                var cWidth = (tv.Bounds.Width - (2 * hBorder));

                cellImg = new UITableViewCell(UITableViewCellStyle.Default, "LargeImagesCell");

                ivImg             = new UIImageView();
                ivImg.Frame       = new RectangleF(hBorder, vBorder, cWidth, cellHeight - (vBorder * 2));
                ivImg.ContentMode = UIViewContentMode.ScaleAspectFit;

                ivImg.Tag = 101;

                cellImg.Add(ivImg);
            }

            ivImg.Image = this.Image;

            return(cellImg);
        }
Пример #5
0
        public override UITableViewCell GetCell(UITableView tv)
        {
            var cell = tv.DequeueReusableCell(ikey);

            if (cell == null)
            {
                cell = new UITableViewCell(UITableViewCellStyle.Default, ikey);
                cell.Add(Image);
            }

            if (tv.Style == UITableViewStyle.Grouped)
            {
                cell.BackgroundColor = UIColor.Clear;
                cell.BackgroundView  = new UIView {
                    BackgroundColor = UIColor.Clear, Frame = new RectangleF(0, 0, 0, 0)
                };
            }
            Image.Image = Value;
            cell.UserInteractionEnabled = false;
            return(cell);
        }
Пример #6
0
        protected override UITableViewCell GetCellImpl(UITableView tv)
        {
            if (cellImg == null)
            {
                var cWidth = (tv.Bounds.Width - (2 * hBorder));

                cellImg = new UITableViewCell(UITableViewCellStyle.Default, "LargeImagesCell");

                ivImg = new UIImageView();
                ivImg.Frame = new RectangleF(hBorder, vBorder, cWidth, cellHeight - (vBorder * 2));
                ivImg.ContentMode = UIViewContentMode.ScaleAspectFit;

                ivImg.Tag = 101;

                cellImg.Add(ivImg);
            }

            ivImg.Image = this.Image;

            return cellImg;
        }
Пример #7
0
        public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath, FeedItem item)
        {
            if (string.IsNullOrEmpty(item.Id) && string.IsNullOrEmpty(item.AdvertisementUrl))
            {
                if (topCell == null)
                {
                    topCell = new UITableViewCell();
                    topCell.SelectionStyle = UITableViewCellSelectionStyle.None;
                    topCell.Add(view);
                    topCell.AddConstraint(NSLayoutConstraint.Create(view, NSLayoutAttribute.Left, NSLayoutRelation.Equal, topCell, NSLayoutAttribute.Left, 1, 0));
                    topCell.AddConstraint(NSLayoutConstraint.Create(view, NSLayoutAttribute.Top, NSLayoutRelation.Equal, topCell, NSLayoutAttribute.Top, 1, 0));
                    topCell.AddConstraint(NSLayoutConstraint.Create(view, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, topCell, NSLayoutAttribute.Bottom, 1, 0));
                    topCell.AddConstraint(NSLayoutConstraint.Create(view, NSLayoutAttribute.Right, NSLayoutRelation.Equal, topCell, NSLayoutAttribute.Right, 1, 0));
                    //AppDelegate.SetViewFont (topCell);
                }
                topCell.SelectionStyle = UITableViewCellSelectionStyle.None;

                return(topCell);
            }
            if (!string.IsNullOrEmpty(item.AdvertisementUrl))
            {
                var cell = tableView.DequeueReusableCell("AdvertisementCell", indexPath) as AdvertisementCell;
                //cell.Position = indexPath.Row;
                cell.SetData(item);
                cell.SelectionStyle = UITableViewCellSelectionStyle.None;
                return(cell);
            }
            else
            {
                var cell = tableView.DequeueReusableCell("FeedCell", indexPath) as FeedCell;
                cell.Position = indexPath.Row;
                SetNewsFeedCellCommon(cell, item);
                cell.SetNeedsUpdateConstraints();
                cell.SetNeedsLayout();
                cell.SelectionStyle = UITableViewCellSelectionStyle.None;
                return(cell);
            }
        }