Inheritance: UITableViewCell
Beispiel #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var beer = Beers[indexPath.Row];
            var cell = tableView.DequeueReusableCell(TrendingBeerCellIndeitifier) as TrendingBeerCell;

            if (cell == null)
            {
                cell = new TrendingBeerCell(new NSString(TrendingBeerCellIndeitifier));
            }

            cell.Name    = beer.Name;
            cell.Brewery = beer?.Brewery.Name;

            if (beer?.HasImages == true)
            {
                cell.Image.SetImage(new NSUrl(beer.Image.MediumUrl), UIImage.FromBundle("BeerDrinkin.png"));
            }
            else
            {
                cell.Image.Image = UIImage.FromBundle("BeerDrinkin.png");
            }


            return(cell);
        }
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var beer = Beers[indexPath.Row];        
            var cell = tableView.DequeueReusableCell(TrendingBeerCellIndeitifier) as TrendingBeerCell;

            if (cell == null)
            {
                cell = new TrendingBeerCell(new NSString(TrendingBeerCellIndeitifier));
            }

            cell.Name = beer.Name;
            cell.Brewery = beer?.Brewery.Name;

            if(beer?.HasImages == true)
                cell.Image.SetImage(new NSUrl(beer.Image.MediumUrl), UIImage.FromBundle("BeerDrinkin.png"));
            else
                cell.Image.Image = UIImage.FromBundle("BeerDrinkin.png");


            return cell;
        }