public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { DetailTableViewCell cell = (DetailTableViewCell)tableView.DequeueReusableCell("CellIdentifier"); if (cell == null) { cell = new DetailTableViewCell(new SizeF(View.Frame.Width, 44f),UITableViewCellStyle.Default, "CellIdentifier"); } if (indexPath.Section == 0) { if (indexPath.Row == 0) { cell.TextLabel.Text = "Naam:";// + ScheduleItem.Name; cell = DecorateCellDetailLabel(cell, ScheduleItem.Name); } else if (indexPath.Row == 1) { cell.TextLabel.Text = "Omschrijving:";// + ScheduleItem.Description; cell = DecorateCellDetailLabel(cell, ScheduleItem.Description); cell.UpdateHeight(); } } else if (indexPath.Section == 1) { if (indexPath.Row == 0) { //locatie cell.TextLabel.Text = "Locatie:";// + ScheduleItem.Location.LocationName; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; cell = DecorateCellDetailLabel(cell, ScheduleItem.Location.LocationName); } else if (indexPath.Row == 1) { //date/time cell.TextLabel.Text = "Tijd:";// + ScheduleItem.DateTime.ToString("F"); cell = DecorateCellDetailLabel(cell, ScheduleItem.DateTime.ToString("F")); } else if (indexPath.Row == 2) { //spreker cell.TextLabel.Text = "Spreker:";// + cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; cell = DecorateCellDetailLabel(cell, ScheduleItem.Speaker.SpeakerName); } } else { //zoek naar andere items met dezelfde categorie cell.TextLabel.Text = "Categorie:";//ScheduleItem.Category.CategoryName; cell = DecorateCellDetailLabel(cell, ScheduleItem.Category.CategoryName); } return cell; }
public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { // Locatie // Organisatie // Praktisch // Achtergrond // Sponsors DetailTableViewCell cell = (DetailTableViewCell)tableView.DequeueReusableCell("CellIdentifier"); if (cell == null) { cell = new DetailTableViewCell(new SizeF(View.Frame.Width, 44f),UITableViewCellStyle.Default, "CellIdentifier"); } if(indexPath.Section == 0) { if (indexPath.Row == 0) { cell.TextLabel.Text = "Locatie"; } else if (indexPath.Row == 1) { //maps? } } else if(indexPath.Section == 1) { if (indexPath.Row == 0) { cell.TextLabel.Text = "Organisatie"; } else if (indexPath.Row == 1) { //tekst cell.TextLabel.Text = "Organisatie"; } } else if(indexPath.Section == 2) { if (indexPath.Row == 0) { cell.TextLabel.Text = "Praktisch"; } else if (indexPath.Row == 1) { //tekst cell.TextLabel.Text = "praktisch"; } } else if(indexPath.Section == 3) { if (indexPath.Row == 0) { cell.TextLabel.Text = "Achtergrond"; } else if (indexPath.Row == 1) { //tekst cell.TextLabel.Text = "AChtergrond"; } } else { if (indexPath.Row == 0) { cell.TextLabel.Text = "Sponsors"; } else if (indexPath.Row == 1) { //ScrollView met imageviews } } return cell; }
private DetailTableViewCell DecorateCellDetailLabel(DetailTableViewCell cell, string text) { PointF zero = new PointF(0, 0); foreach(UIView subview in cell.CellDetailView.Subviews) { subview.RemoveFromSuperview(); } UILabel cellDetailLabel = new UILabel(new RectangleF(zero, cell.CellDetailView.Frame.Size)); cellDetailLabel.Text = text; cellDetailLabel.Lines = 0; cell.CellDetailView.Add(cellDetailLabel); return cell; }
public UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { DetailTableViewCell cell = (DetailTableViewCell)tableView.DequeueReusableCell("CellIdentifier"); if (cell == null) { cell = new DetailTableViewCell(new SizeF(View.Frame.Width, 44f),UITableViewCellStyle.Default, "CellIdentifier"); } if (indexPath.Section == 0) { if (indexPath.Row == 0) { cell.TextLabel.Text = "Naam:"; cell = DecorateCellDetailLabel(cell, Speaker.SpeakerName); } else if (indexPath.Row == 1) { cell.TextLabel.Text = "Contactgegevens:"; cell = DecorateCellDetailLabel(cell, Speaker.ContactInfo); cell.UpdateHeight(); float x = View.Frame.Width - 159; if (!string.IsNullOrWhiteSpace(Speaker.FacebookLink)) { facebookButton = new FacebookLinkButton(new RectangleF(x, 0, 44, 44), Speaker.FacebookLink) { BackgroundColor = UIColor.Red }; facebookButton.TouchUpInside += (object sender, EventArgs e) => { OpenLink(new NSUrl(facebookButton.URL)); }; cell.Add(facebookButton); x += 50; } if (!string.IsNullOrWhiteSpace(Speaker.LinkedInLink)) { linkedinButton = new LinkedInLinkButton(new RectangleF(x, 0, 44, 44), Speaker.LinkedInLink) { BackgroundColor = UIColor.Red }; linkedinButton.TouchUpInside += (object sender, EventArgs e) => { OpenLink(new NSUrl(linkedinButton.URL)); }; cell.Add(linkedinButton); x += 50; } if (!string.IsNullOrWhiteSpace(Speaker.TwitterLink)) { twitterButton = new TwitterLinkButton(new RectangleF(x, 0, 44, 44), Speaker.TwitterLink) { BackgroundColor = UIColor.Red }; twitterButton.TouchUpInside += (object sender, EventArgs e) => { OpenLink(new NSUrl(twitterButton.URL)); }; cell.Add(twitterButton); } } } else { cell.TextLabel.Text = "Bio:"; cell = DecorateCellDetailLabel(cell, Speaker.Biography); } return cell; }