/// <summary> /// Called by the TableView to get the actual UITableViewCell to render for the particular row /// </summary> public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.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); // DCTCell cell = tableView.DequeueReusableCell (cellIdentifier) as DCTCell; if (cell == null) cell = new DCTCell ((MonoTouch.Foundation.NSString)cellIdentifier); //cell.Editing = true; // Make the cell deletable //cell.ShouldIndentWhileEditing = true; //cell.ShowingDeleteConfirmation = true; cell.TextLabel.Text = indexedTableItems[keys[indexPath.Section]][indexPath.Row]; //cell. // BlackLeatherTheme.Apply(cell); cell.Layer.CornerRadius = 7.0f; cell.Layer.MasksToBounds = true; cell.Layer.BorderWidth = 2.0f; cell.Layer.BorderColor = UIColor.FromRGBA (34f,139f,34f, 0.9f).CGColor; cell.TintColor = UIColor.Orange; cell.BackgroundColor = UIColor.FromRGBA (34f,139f,34f, 0.5f); return cell; }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { // FileHandler fh = new FileHandler (); Lager o = tableItems [indexPath.Row]; // string sub = o.subtitle; // UIImage image = fh.loadUserImage (imageFile); // cell.ImageView.Image = UIImage.FromFile ("Images/" +tableItems[indexPath.Row].ImageName); // var documentsDirectory = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // bool exists = true; // UIImage image = null; // if (o.thumbFileName == null) { // o.thumbFileName = "NONEXISTANT.png"; // } // // string filename = System.IO.Path.Combine (documentsDirectory, o.thumbFileName); // // if (File.Exists (filename)) { // image = UIImage.FromFile (filename); // } else { // exists = false; // } // var cellStyle = UITableViewCellStyle.Subtitle; DCTCell cell = tableView.DequeueReusableCell (cellIdentifier) as DCTCell; if (cell == null) cell = new DCTCell ((MonoTouch.Foundation.NSString)o.Name); // cell.Accessory = UITableViewCellAccessory.DetailDisclosureButton; // Xamarin.Themes.BlackLeatherTheme.Apply (cell); // if (exists) // cell.UpdateCell (o.Name, image, o.Description); // else cell.UpdateCell (o.Name, o.address); cell.Layer.CornerRadius = 7.0f; cell.Layer.MasksToBounds = true; cell.Layer.BorderWidth = 2.0f; cell.Layer.BorderColor = UIColor.FromRGBA (34f,139f,34f, 0.9f).CGColor; cell.TintColor = UIColor.Orange; cell.BackgroundColor = UIColor.FromRGBA (34f,139f,34f, 0.5f); return cell; }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { Item item = tableItems[indexPath.Row]; UIImage image; bool nill = false; if (item.ImageFileName == null) { image = UIImage.FromFile ("first.png"); //TODO Fix bedre default nill = true; } else { var documentsDirectory = Environment.GetFolderPath (Environment.SpecialFolder.Personal); string filename = System.IO.Path.Combine (documentsDirectory, item.ThumbFileName); image = UIImage.FromFile (filename); //TODO get a better default image } DCTCell cell = tableView.DequeueReusableCell (cellIdentifier) as DCTCell; if (cell == null) cell = new DCTCell ((MonoTouch.Foundation.NSString)item.Name); // Xamarin.Themes.BlackLeatherTheme.Apply (cell); if (!nill) { cell.UpdateCell (item.Name, image, item.Description); } else { cell.UpdateCell(item.Name, item.Description); } cell.Layer.CornerRadius = 7.0f; cell.Layer.MasksToBounds = true; cell.Layer.BorderWidth = 2.0f; cell.Layer.BorderColor = UIColor.FromRGBA (34f,139f,34f, 0.9f).CGColor; cell.TintColor = UIColor.Orange; cell.BackgroundColor = UIColor.FromRGBA (34f,139f,34f, 0.5f); return cell; }
public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) { ImageTag item = tableItems[indexPath.Row]; DCTCell cell = tableView.DequeueReusableCell (cellIdentifier) as DCTCell; if (cell == null) cell = new DCTCell ((MonoTouch.Foundation.NSString)item.ID.ToString()); cell.UpdateCell(item.ID.ToString(),item.TagString); cell.Layer.CornerRadius = 7.0f; cell.Layer.MasksToBounds = true; cell.Layer.BorderWidth = 2.0f; cell.Layer.BorderColor = UIColor.FromRGBA (34f,139f,34f, 0.9f).CGColor; cell.TintColor = UIColor.Orange; cell.BackgroundColor = UIColor.FromRGBA (34f,139f,34f, 0.5f); return cell; }
/// <summary> /// called by the table to generate the cell to display. in this case, it's very simple /// and just displays the word. /// </summary> public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { // declare vars DCTCell cell = (DCTCell)tableView.DequeueReusableCell (cellIdentifier); string word = words[indexPath.Row].value; // if there are no cells to reuse, create a new one if (cell == null) cell = new DCTCell (new NSString (word)); if (words [indexPath.Row].Name == null) { cell.UpdateCell (words [indexPath.Row].value, words [indexPath.Row].type); } else { cell.UpdateCell (words [indexPath.Row].Name, words [indexPath.Row].type); } // set the item text cell.Layer.CornerRadius = 7.0f; cell.Layer.MasksToBounds = true; cell.Layer.BorderWidth = 2.0f; cell.Layer.BorderColor = UIColor.FromRGBA (34f,139f,34f, 0.9f).CGColor; cell.TintColor = UIColor.Orange; cell.BackgroundColor = UIColor.FromRGBA (34f,139f,34f, 0.5f); return cell; }