コード例 #1
0
ファイル: SurveyTableSource.cs プロジェクト: agholap/Survey
        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
ファイル: SurveyTableSource.cs プロジェクト: agholap/Survey
        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);
        }