コード例 #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(ValueOfCell) as CustomCell;

            if (cell == null)
            {
                cell = new CustomCell(Cell_ID);
            }

            var entry = Custom_Table_Items [indexPath.Section].Items [indexPath.Row];

            cell.UpdateCell(entry.OverallCriticScore, entry.AbridgedCast[0].Name + ", " + entry.AbridgedCast[1].Name, " ," + entry.Runtime, entry.TheatreReleaseDate, entry.MovieTitle, entry.MovieThumbnail, entry.FreshOrRotten, entry.MPAA_Rating);
            return(cell);


            /*
             *
             *
             * var cell = tableView.DequeueReusableCell(ValueOfCell) ??
             *      new UITableViewCell(UITableViewCellStyle.Subtitle, ValueOfCell);
             *
             * var entry = Movies[indexPath.Row];
             * cell.TextLabel.Text = entry.MovieTitle;
             * NSUrl nsUrl = new NSUrl(entry.MovieThumbnail);
             * NSData data = NSData.FromUrl(nsUrl);
             * cell.ImageView.Image = new UIImage (data);
             * Boolean? RotOrFresh = entry.FreshOrRotten;
             * UIImageView Rotten_Or_Fresh_Image = new UIImageView();
             *
             * if (RotOrFresh == true) {
             *      Rotten_Or_Fresh_Image.Image = UIImage.FromBundle ("fresh.png");
             * } else if (RotOrFresh == false) {
             *      Rotten_Or_Fresh_Image.Image = UIImage.FromBundle ("rotten.png");
             * } else {
             *      Rotten_Or_Fresh_Image.Image = UIImage.FromBundle ("QuestionMark.png");
             * }
             *
             * cell.DetailTextLabel.Text = entry.OverallCriticScore + Environment.NewLine+ entry.AbridgedCast [0].Name + ", " + entry.AbridgedCast [1].Name + Environment.NewLine + entry.MPAA_Rating + ", " + entry.Runtime + Environment.NewLine + entry.TheatreReleaseDate;
             * cell.DetailTextLabel.Font = UIFont.FromName ("AmericanTypeWriter", 8f);
             *
             * cell.DetailTextLabel.LineBreakMode = UILineBreakMode.WordWrap;
             * cell.DetailTextLabel.Lines = 0;
             *
             * RectangleF Cell_Props = cell.Frame;
             * Cell_Props.Height = 150f;
             * cell.Frame = Cell_Props;
             * return cell;
             *
             */
        }
		public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
		{


			var cell = tableView.DequeueReusableCell (ValueOfCell) as CustomCell;
			if (cell == null) {
				cell = new CustomCell (Cell_ID);
			}

			var entry = Custom_Table_Items [indexPath.Section].Items [indexPath.Row];
			cell.UpdateCell (entry.OverallCriticScore,entry.AbridgedCast[0].Name+", "+entry.AbridgedCast[1].Name," ,"+entry.Runtime,entry.TheatreReleaseDate,entry.MovieTitle,entry.MovieThumbnail,entry.FreshOrRotten,entry.MPAA_Rating);
			return cell;


			/*


			var cell = tableView.DequeueReusableCell(ValueOfCell) ??
				new UITableViewCell(UITableViewCellStyle.Subtitle, ValueOfCell);

			var entry = Movies[indexPath.Row];
			cell.TextLabel.Text = entry.MovieTitle;
			NSUrl nsUrl = new NSUrl(entry.MovieThumbnail);
			NSData data = NSData.FromUrl(nsUrl);
			cell.ImageView.Image = new UIImage (data);
			Boolean? RotOrFresh = entry.FreshOrRotten;
			UIImageView Rotten_Or_Fresh_Image = new UIImageView();

			if (RotOrFresh == true) {
				Rotten_Or_Fresh_Image.Image = UIImage.FromBundle ("fresh.png");
			} else if (RotOrFresh == false) {
				Rotten_Or_Fresh_Image.Image = UIImage.FromBundle ("rotten.png");
			} else {
				Rotten_Or_Fresh_Image.Image = UIImage.FromBundle ("QuestionMark.png");
			}

			cell.DetailTextLabel.Text = entry.OverallCriticScore + Environment.NewLine+ entry.AbridgedCast [0].Name + ", " + entry.AbridgedCast [1].Name + Environment.NewLine + entry.MPAA_Rating + ", " + entry.Runtime + Environment.NewLine + entry.TheatreReleaseDate;
			cell.DetailTextLabel.Font = UIFont.FromName ("AmericanTypeWriter", 8f);

			cell.DetailTextLabel.LineBreakMode = UILineBreakMode.WordWrap;
			cell.DetailTextLabel.Lines = 0;

			RectangleF Cell_Props = cell.Frame;
			Cell_Props.Height = 150f;
			cell.Frame = Cell_Props;
			return cell;

			*/
		}