예제 #1
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            //// request a recycled cell to save memory
            //UITableViewCell cell = tableView.DequeueReusableCell(cellIdentifier);
            //// if there are no cells to reuse, create a new one
            //if (cell == null)
            //    cell = new UITableViewCell(UITableViewCellStyle.Default, cellIdentifier);
            //cell.TextLabel.Text = tableItems[indexPath.Row];
            //return cell;
            SurveyCell cell = tableView.DequeueReusableCell(cellId) as SurveyCell;

            if (cell == null)
                cell = new SurveyCell(days[indexPath.Row], days[indexPath.Row], cellId);
            else
                cell.UpdateCell(days[indexPath.Row], days[indexPath.Row]);

            cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            return cell;
        }
예제 #2
0
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            //// request a recycled cell to save memory
            //UITableViewCell cell = tableView.DequeueReusableCell(cellIdentifier);
            //// if there are no cells to reuse, create a new one
            //if (cell == null)
            //    cell = new UITableViewCell(UITableViewCellStyle.Default, cellIdentifier);
            //cell.TextLabel.Text = tableItems[indexPath.Row];
            //return cell;
            SurveyCell cell = tableView.DequeueReusableCell(cellId) as SurveyCell;

            if (cell == null)
            {
                cell = new SurveyCell(days[indexPath.Row], days[indexPath.Row], cellId);
            }
            else
            {
                cell.UpdateCell(days[indexPath.Row], days[indexPath.Row]);
            }

            cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
            return(cell);
        }