public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { if (UseCustomCells) { string reuseIdentifier = "UMCell"; UMTableViewCell cell = (UMTableViewCell)tableView.DequeueReusableCell(reuseIdentifier); // optionally specify a width that each set of utility buttons will share cell.SetLeftUtilityButtons(LeftButtons(), 32.0f); cell.SetRightUtilityButtons(RightButtons(), 58.0f); cell.Delegate = cellDelegate; cell.Label.Text = string.Format("Section: {0}, Seat: {1}", indexPath.Section, indexPath.Row); return(cell); } else { string cellIdentifier = "Cell"; SWTableViewCell.SWTableViewCell cell = (SWTableViewCell.SWTableViewCell)tableView.DequeueReusableCell(cellIdentifier); if (cell == null) { cell = new SWTableViewCell.SWTableViewCell(UITableViewCellStyle.Subtitle, cellIdentifier); cell.LeftUtilityButtons = LeftButtons(); cell.RightUtilityButtons = RightButtons(); cell.Delegate = cellDelegate; } cell.TextLabel.Text = string.Format("Seat: {0}", testArray [indexPath.Section] [indexPath.Row]); cell.DetailTextLabel.Text = string.Format("Details for seat {1} in section: {0}.", indexPath.Section, indexPath.Row); return(cell); } }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { if (useCustomCells) { UMTableViewCell cell = (UMTableViewCell)tableView.DequeueReusableCell("UMCell"); // we assume that only new cells have no delegate if (cell.Delegate == null) { cell.Delegate = cellDelegate; // optionally specify a width that each set of utility buttons will share cell.SetLeftUtilityButtons(LeftButtons(), 32.0f); cell.SetRightUtilityButtons(RightButtons(), 58.0f); } cell.Label.Text = string.Format("Section: {0}, Seat: {1}", indexPath.Section, indexPath.Row); return(cell); } else { SWTableViewCell cell = (SWTableViewCell)tableView.DequeueReusableCell("Cell"); // we assume that only new cells have no delegate if (cell.Delegate == null) { cell.Delegate = cellDelegate; cell.RightUtilityButtons = RightButtons(); cell.LeftUtilityButtons = LeftButtons(); } cell.TextLabel.Text = string.Format("Seat: {0}", testArray [indexPath.Section] [indexPath.Row]); cell.DetailTextLabel.Text = string.Format("Details for seat {1} in section: {0}.", indexPath.Section, indexPath.Row); return(cell); } }