public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = listView.DequeueReusableCell("cell", indexPath) as TKListViewCell; cell.TextLabel.Text = this.owner.sampleArrayOfStrings.GetItem <NSString> ((uint)indexPath.Row); return(cell); }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { var cell = listView.DequeueReusableCell("cell", indexPath) as ListViewVariableSizeCell; cell.label.Text = this.items[indexPath.Row]; return(cell); }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = (TKListViewCell)listView.DequeueReusableCell("cell", indexPath); NSString imageName = (NSString)this.owner.Photos.Items [indexPath.Row]; cell.ImageView.Image = UIImage.FromBundle(imageName); cell.TextLabel.Text = (NSString)this.owner.Names.Items [indexPath.Row]; return(cell); }
public override void ViewDidLoad() { AddOption("Scale in", ScaleInSelected); AddOption("Fade in", FadeInSelected); AddOption("Slide in", SlideInSelected); base.ViewDidLoad(); string s = TKChart.VersionString; this.dataSource.LoadDataFromJSONResource("ListViewSampleData", "json", "photos"); this.dataSource.Settings.ListView.CreateCell((TKListView listView, NSIndexPath indexPath, NSObject item) => { return(listView.DequeueReusableCell("cell", indexPath) as TKListViewCell); }); this.dataSource.Settings.ListView.InitCell(delegate(TKListView listView, NSIndexPath indexPath, TKListViewCell cell, NSObject item) { cell.ImageView.Image = UIImage.FromBundle(this.dataSource.Items[indexPath.Row] as NSString); }); this.listView.Frame = this.View.Bounds; this.listView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; this.listView.WeakDataSource = this.dataSource; this.listView.RegisterClassForCell(new ObjCRuntime.Class(typeof(AnimationListCell)), "cell"); this.View.AddSubview(this.listView); var layout = new TKListViewGridLayout(); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { layout.SpanCount = 3; } else { layout.SpanCount = 2; } layout.ItemSize = new CGSize(130, 180); layout.ItemSpacing = 10; layout.LineSpacing = 10; // >> listview-alignment-cs layout.ItemAlignment = TKListViewItemAlignment.Center; // << listview-alignment-cs layout.ItemAppearAnimation = TKListViewItemAnimation.Scale; // >> listview-animation-duration-cs layout.AnimationDuration = 0.4f; // << listview-animation-duration-cs this.listView.Layout = layout; }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = listView.DequeueReusableCell("cell", indexPath) as TKListViewCell; bool isUpdated = this.owner.IsUpdated(indexPath); cell.TextLabel.Text = this.owner.data [indexPath.Row]; cell.BackgroundView.BackgroundColor = isUpdated ? new UIColor(1f, 1f, 0f, 0.4f) : UIColor.White; if (isUpdated) { UIView.Animate(0.5f, () => { cell.BackgroundView.Alpha = 1; }); } return(cell); }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = listView.DequeueReusableCell("cell", indexPath) as TKListViewCell; cell.BackgroundView.BackgroundColor = UIColor.FromWhiteAlpha(0.3f, 0.5f); string imageName = this.owner.photos.Items [indexPath.Row] as NSString; cell.ImageView.Image = new UIImage(imageName); cell.TextLabel.Text = this.owner.names.Items [indexPath.Row] as NSString; Random r = new Random(); cell.DetailTextLabel.Text = this.owner.loremIpsum.RandomString(10 + r.Next(0, 16), indexPath); cell.DetailTextLabel.TextColor = UIColor.White; ((TKView)cell.BackgroundView).Stroke = null; return(cell); }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = listView.DequeueLoadOnDemandCell (indexPath); if (cell == null) { cell = listView.DequeueReusableCell ("cell", indexPath) as TKListViewCell; cell.ImageView.Image = new UIImage (this.owner.photos.Items [indexPath.Row] as NSString); cell.TextLabel.Text = this.owner.names.Items [indexPath.Row] as NSString; Random r = new Random (); cell.DetailTextLabel.Text = this.owner.loremIpsum.RandomString (10 + r.Next (0, 16), indexPath); cell.DetailTextLabel.TextColor = UIColor.White; } cell.BackgroundView.BackgroundColor = UIColor.FromWhiteAlpha (0.3f, 0.5f); ((TKView)cell.BackgroundView).Stroke = null; return cell; }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = (TKListViewCell)listView.DequeueReusableCell ("cell", indexPath); NSString imageName = (NSString)this.owner.Photos.Items [indexPath.Row]; cell.ImageView.Image = new UIImage (imageName); cell.TextLabel.Text = (NSString)this.owner.Names.Items [indexPath.Row]; return cell; }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { TKListViewCell cell = listView.DequeueReusableCell ("cell", indexPath) as TKListViewCell; bool isUpdated = this.owner.IsUpdated (indexPath); cell.TextLabel.Text = this.owner.data [indexPath.Row]; cell.BackgroundView.BackgroundColor = isUpdated ? new UIColor (1f, 1f, 0f, 0.4f) : UIColor.White; if (isUpdated) { UIView.Animate (0.5f, () => { cell.BackgroundView.Alpha = 1; }); } return cell; }
public override TKListViewCell CellForItem(TKListView listView, NSIndexPath indexPath) { var cell = listView.DequeueReusableCell ("cell", indexPath) as ListViewVariableSizeCell; cell.label.Text = this.items[indexPath.Row]; return cell; }