Advertisement
Guest User

table source

a guest
Aug 14th, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 KB | None | 0 0
  1. using System;
  2. using UIKit;
  3.  
  4. namespace testernew
  5. {
  6.     public class TableSource : UITableViewSource
  7.     {
  8.         unclass[] tableItems;
  9.         string cellIdentifier = "TableCell";
  10.  
  11.         public TableSource (unclass[] items)
  12.         {
  13.             tableItems = items;
  14.         }
  15.  
  16.         public override nint RowsInSection (UITableView tableview, nint section)
  17.         {
  18.             return tableItems.Length;
  19.         }
  20.  
  21.         public override nfloat GetHeightForRow (UITableView tableView, Foundation.NSIndexPath indexPath)
  22.         {
  23.  
  24.             return 340;
  25.         }
  26.         public override UITableViewCell GetCell (UITableView tableView, Foundation.NSIndexPath indexPath)
  27.         {
  28.             var cell = tableView.DequeueReusableCell (cellIdentifier) as CustomVegeCell;
  29.             if (cell == null) {
  30.                 cell = new CustomVegeCell(cellIdentifier);
  31.             }
  32.  
  33.             cell.UpdateCell (tableItems [indexPath.Row].imager);
  34.  
  35.             //tableItems[indexPath.Row].
  36.                 //cell.TextLabel.Text = tableItems [indexPath.Row].;
  37.             //c//ell.ImageView.Image = UIImage.FromFile ("babymon.png");
  38.                     return cell;
  39.            
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement