// Customize the appearance of table view cells. public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { string cellIdentifier = "Cell"; var cell = tableView.DequeueReusableCell(cellIdentifier); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, cellIdentifier); cell.SelectionStyle = UITableViewCellSelectionStyle.None; } if (indexPath.Section == 0) { cell.TextLabel.Text = controller.Play.Date.Year.ToString(); } else if (indexPath.Section == 1) { cell.TextLabel.Text = controller.Play.Genre; } else { cell.TextLabel.Text = controller.Play.Characters [indexPath.Row]; } return(cell); }
/// <summary> /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row /// </summary> public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { //---- declare vars UITableViewCell cell = tableView.DequeueReusableCell(cellIdentifier); TableItem item = tableItems[indexPath.Section].Items[indexPath.Row]; //---- if there are no cells to reuse, create a new one if (cell == null) { cell = new UITableViewCell(item.CellStyle, cellIdentifier); } //---- set the item text cell.TextLabel.Text = tableItems[indexPath.Section].Items[indexPath.Row].Heading; //---- if it's a cell style that supports a subheading, set it if (item.CellStyle == UITableViewCellStyle.Subtitle || item.CellStyle == UITableViewCellStyle.Value1 || item.CellStyle == UITableViewCellStyle.Value2) { cell.DetailTextLabel.Text = item.SubHeading.ToString(); } //---- if the item has a valid image, and it's not the contact style (doesn't support images) //if (! string.IsNullOrEmpty(item.ImageName) && item.CellStyle != UITableViewCellStyle.Value2) //{ // if (File.Exists(item.ImageName)) // { cell.ImageView.Image = UIImage.FromBundle(item.ImageName); } //} //---- set the accessory cell.Accessory = item.CellAccessory; return(cell); }
// Customize the appearance of table view cells. public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { string cellIdentifier = "QueueCell"; var cell = tableView.DequeueReusableCell(cellIdentifier); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, cellIdentifier); } LocalProgramHelper localProgram = new LocalProgramHelper(downloads[indexPath.Row]); cell.TextLabel.Text = localProgram.Program.Name; cell.DetailTextLabel.Text = localProgram.Program.Description; cell.DetailTextLabel.Font = UIFont.SystemFontOfSize(IplayerConst.DetailTextLabelSize); cell.ImageView.Image = localProgram.ThumbnailImageForTableView; cell.Accessory = UITableViewCellAccessory.None; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell(cellIdentifier); // if there are no cells to reuse, create a new one if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, cellIdentifier); } cell.TextLabel.Text = tableItems[indexPath.Row].ToString(); cell.TextLabel.Font = UIFont.SystemFontOfSize(15); cell.TextLabel.Lines = 2; if (tableItems [indexPath.Row].idEstatus.Equals("Finalizado")) { cell.ImageView.Image = UIImage.FromFile("Images/green.png"); } else if (tableItems [indexPath.Row].idEstatus.Equals("En Proceso")) { cell.ImageView.Image = UIImage.FromFile("Images/orange.png"); } cell.DetailTextLabel.Text = tableItems[indexPath.Row].nombreSolicitante + "\n" + tableItems[indexPath.Row].idPrioridad; cell.DetailTextLabel.Lines = 2; cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; return(cell); }
public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (OnComparisonSelected != null) { OnComparisonSelected(this, EventArgs.Empty); } }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell(_cellIdentifier); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Subtitle, _cellIdentifier); } int row = indexPath.Row; if (row < _properties.Count) { var property = _properties [indexPath.Row]; cell.TextLabel.Text = property.FormattedPrice; cell.DetailTextLabel.Text = property.Title; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; cell.ImageView.Frame = new RectangleF(cell.ImageView.Frame.Location, new SizeF(60, 60)); DispatchQueue.DefaultGlobalQueue.DispatchAsync(() => { UIImage image = UIImage.LoadFromData(NSData.FromUrl(new NSUrl(property.ThumbnailUrl))); DispatchQueue.MainQueue.DispatchAsync(() => { cell.ImageView.Image = image; cell.SetNeedsLayout(); }); }); } else { cell.TextLabel.Text = "Load more ..."; cell.DetailTextLabel.Text = string.Format("Showing {0:d} of {1:d} matches", _properties.Count, _totalResults); cell.ImageView.Image = null; } return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell(_cellId); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, _cellId); // Set its Accessory if it should be highlighted. //if (indexPath.Row == Settings.SelectedIndex) // cell.Accessory = UITableViewCellAccessory.Checkmark; //UIImageView imageView1 = new UIImageView(UIImage.FromFile("bulb_off.png"),UIImage.FromFile("bulb_off.png")); //UIImageView imageView1 = new UIImageView(new RectangleF(0,0,150,100)); //imageView1.Image = UIImage.FromFile("bulb_off.png"); //cell.ImageView.Frame = new RectangleF(50,0,150,100); //cell.AccessoryView = imageView1; //cell.ImageView.Image = UIImage.FromFile("SeriesIcons/bar.png"); } cell.IndentationWidth = 10; cell.IndentationLevel = 1; cell.TextLabel.Text = Items[indexPath.Row].Text; cell.ImageView.Image = UIImage.FromFile(Items[indexPath.Row].ImagePath); return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var item = this.Data[indexPath.Row] as Stock; if (item == null) { return(base.GetCell(tableView, indexPath)); } var cellProvider = tableView as ITableCellProvider; if (cellProvider != null) { return(cellProvider.GetCell(item)); } var cell = tableView.DequeueReusableCell(StockCell.Key) as StockCell; if (cell == null) { cell = StockCell.Create(); //var views = NSBundle.MainBundle.LoadNib("StockTableCell", cell, null); //cell = Runtime.GetNSObject( views.ValueAt(0) ) as StockTableCell; } cell.Bind(item); return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { const string cellIdentifier = "Cell"; var cell = tableView.DequeueReusableCell(cellIdentifier); if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, cellIdentifier); } // Get count var g = AssetGroups [indexPath.Row]; g.SetAssetsFilter(ALAssetsFilter.AllPhotos); var gCount = g.Count; cell.TextLabel.Text = string.Format("{0} ({1})", g.Name, gCount); try { cell.ImageView.Image = new UIImage(g.PosterImage); } catch (Exception e) { Console.WriteLine("Failed to set thumbnail {0}", e); } cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var section = Root.Sections [indexPath.Section]; var element = section.Elements [indexPath.Row]; return(element.GetCell(tableView)); }
/// <summary> /// Called by the TableView to get the actual UITableViewCell to render for the particular section and row /// </summary> public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { //---- declare vars UITableViewCell cell = tableView.DequeueReusableCell(this._cellIdentifier); //---- if there are no cells to reuse, create a new one if (cell == null) { cell = new UITableViewCell(UITableViewCellStyle.Default, this._cellIdentifier); } //---- create a shortcut to our item BasicTableViewItem item = this._tableItems[indexPath.Section].Items[indexPath.Row]; cell.TextLabel.Text = item.Movie.title; if (!string.IsNullOrEmpty(item.Movie.thumbNail)) { MonoTouch.Foundation.NSUrl nsUrl = new MonoTouch.Foundation.NSUrl(item.Movie.thumbNail); MonoTouch.Foundation.NSData data = MonoTouch.Foundation.NSData.FromUrl(nsUrl); var myImage = new UIImage(data); cell.ImageView.Image = myImage; } return(cell); }
float IElementSizing.GetHeight(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var captionFont = UIFont.BoldSystemFontOfSize(17); float height = tableView.StringSize(Caption, captionFont).Height; return(height + 10); }
public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var session = groupedFavorites[indexPath.Section].Sessions[indexPath.Row]; FavoriteClicked(this, new FavoriteClickedEventArgs(session)); tableView.DeselectRow(indexPath, true); }
public override float GetHeightForRow(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (_usedForHeight == null) { _usedForHeight = (NewsCellView)tableView.DequeueReusableCell(NewsCellView.Key); } var item = ItemAt(indexPath) as EventItemViewModel; if (item != null) { var s = 6f + NewsCellView.TimeFont.LineHeight + 5f + (NewsCellView.HeaderFont.LineHeight * 2) + 4f + 7f; _usedForHeight.ViewModel = item; if (_usedForHeight.BodyString.Length == 0) { return(s); } var rec = _usedForHeight.BodyString.GetBoundingRect(new SizeF(tableView.Bounds.Width - 56, 10000), NSStringDrawingOptions.UsesLineFragmentOrigin | NSStringDrawingOptions.UsesFontLeading, null); var height = rec.Height; if (item.BodyBlocks.Count == 1 && height > (CharacterHeight * 4)) { height = CharacterHeight * 4; } var descCalc = s + height; var ret = ((int)Math.Ceiling(descCalc)) + 1f + 8f; return(ret); } return(base.GetHeightForRow(tableView, indexPath)); }
/* * // Override to support rearranging the table view. * public override void MoveRow (UITableView tableView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath) * { * } */ /* * // Override to support conditional rearranging of the table view. * public override bool CanMoveRow (UITableView tableView, NSIndexPath indexPath) * { * // Return false if you do not want the item to be re-orderable. * return true; * } */ // Override to support row selection in the table view. public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { // Navigation logic may go here -- for example, create and push another view controller. //var programDetailViewController = new ProgramDetailViewController (); //programDetailViewController.SelectedProgram = programs[indexPath.Row]; //controller.NavigationController.PushViewController(programDetailViewController, true); }
public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var cell = tableView.CellAt(indexPath) as TableViewCells.ContactCell; cell.ViewModel.AcceptCommand.Execute(null); tableView.DeselectRow(indexPath, true); }
public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var selectedSponsor = _viewModel.Tiers[indexPath.Section].Sponsors[indexPath.Row]; var sponsorController = new SponsorViewController(selectedSponsor); _hostController.NavigationController.PushViewController( sponsorController, true); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell(CellIdentifier) ?? new UITableViewCell(UITableViewCellStyle.Default, CellIdentifier); cell.TextLabel.Text = Data[indexPath.Row].ToString(); return(cell); }
public override float GetHeightForRow(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = PrepareCell(tableView, indexPath); cells.Add(cell); totalCellHeight += cell.Frame.Height; return(cell.Frame.Height); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = tableView.DequeueReusableCell(kTableViewCellIdentifier, indexPath); cell.TextLabel.Text = _visibleResults[indexPath.Row]; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (isStopListSection(indexPath.Section)) { //the section with all the stops UITableViewCell stopCell; BusStop stop = allStops [indexPath.Row]; //cells with distance if (closestCalculated && myLocation != null) { stopCell = tableView.DequeueReusableCell("stopCellWithDistance"); double distanceFrom = myLocation.Distancefrom(stop.location); distanceFrom *= 0.0006214; stopCell.DetailTextLabel.Text = "" + Math.Round(distanceFrom, 3) + " mi"; //cell without distance } else { stopCell = tableView.DequeueReusableCell("stopCellWithoutDistance"); } //show checkmark on the bus cell if not on current location and this is the default stop if (UserPreferences.PreferCurrentLocation == false && stop.stopId == UserPreferences.DefaultStopId) { stopCell.Accessory = UITableViewCellAccessory.Checkmark; } else { stopCell.Accessory = UITableViewCellAccessory.None; } stopCell.TextLabel.Text = stop.name; return(stopCell); } else { //the section to select the nearest UITableViewCell closestCell = tableView.DequeueReusableCell("closestCell"); //subtitle shows nearest stop closestCell.DetailTextLabel.Text = "Currently: " + allStops [0].name; //checkmark if (UserPreferences.PreferCurrentLocation) { closestCell.Accessory = UITableViewCellAccessory.Checkmark; } else { closestCell.Accessory = UITableViewCellAccessory.None; } return(closestCell); } }
/// <summary> /// Returns row by id /// </summary> public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { switch (indexPath.Section) { case 0: switch (indexPath.Row) { case 0: return(_Controller._PageTransitionStyleCell); case 1: return(_Controller._PageNavigationOrientationCell); } break; case 1: switch (indexPath.Row) { case 0: return(_Controller._ToolbarVisibilityCell); case 1: return(_Controller._BottombarVisibilityCell); case 2: return(_Controller._PageNumberVisibilityCell); } break; case 2: switch (indexPath.Row) { case 0: return(_Controller._AutoScaleMode); case 1: return(_Controller._ZoomScaleLevelsCell); case 2: return(_Controller._ZoomByDoubleTouchCell); } break; case 3: switch (indexPath.Row) { case 0: return(_Controller._LibraryReleaseDateCell); case 1: return(_Controller._LibraryVersionCell); } break; } return(null); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var employee = employees[indexPath.Row]; var cell = tableView.DequeueReusableCell(cellIdentifier); cell.TextLabel.Text = employee.NameFormatted; cell.DetailTextLabel.Text = employee.Department; return(cell); }
// public override float EstimatedHeightForFooter (UITableView tableView, int section) // { // return UITableView.AutomaticDimension; // } public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(ExpandableTableViewCell.Key) as ExpandableTableViewCell ?? new ExpandableTableViewCell(); cell.Label1.Text = "Title " + indexPath.Row; cell.Label2.Text = "Subtitle " + indexPath.Row; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(SPONSOR_CELL) ?? new UITableViewCell(UITableViewCellStyle.Default, SPONSOR_CELL); cell.TextLabel.Text = _viewModel.Tiers[indexPath.Section].Sponsors[indexPath.Row].Name; cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return(cell); }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { Console.WriteLine(" Id:" + tableItems[indexPath.Row].Id + " " + tableItems[indexPath.Row].Name); // in a Storyboard, Dequeue will ALWAYS return a cell, UITableViewCell cell = tableView.DequeueReusableCell(cellIdentifier); cell.TextLabel.Text = tableItems[indexPath.Row].Name; cell.DetailTextLabel.Text = tableItems[indexPath.Row].Symbol; return(cell); }
public override float GetHeightForRow(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { RSSItem rssItem = RSSItemList[indexPath.Row]; float textHeight = HeightOfText(CodeProjectRssFeedViewModel.StripHTML(rssItem.Description), 267); float height = RoundValueToNearestMultiple(textHeight, 18.5f) + 50; return(height); }
public override void RowSelected(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { var speaker = speakers[indexPath.Row]; view.SelectSpeaker(speaker); if (AppDelegate.IsPhone) { tableView.DeselectRow(indexPath, true); } }
public void RowSelected(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { if (indexPath.Section == 1) { MMDrawerController_UIViewController.Mm_drawerController.SetMaximumLeftDrawerWidth((float)this.DrawerWidths.ValueAt((uint)indexPath.Row).ToInt32(), true, null); } else { base.RowSelected(tableView, indexPath); } }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { UITableViewCell cell = cells [indexPath.Row]; int totalVisibleRows = tableView.IndexPathsForVisibleRows.Length; if (indexPath.Row == totalVisibleRows - 1) { onTableCellsPopulated(totalCellHeight); } return(cell); }