• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UICollectionView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UICollectionView的典型用法代码示例。如果您正苦于以下问题:C# UICollectionView类的具体用法?C# UICollectionView怎么用?C# UICollectionView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UICollectionView类属于命名空间,在下文中一共展示了UICollectionView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ItemSelected

        public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            if (lastSelectedCell != null) {
                lastSelectedCell.BackgroundColor = UIColor.Clear;
            }

            var cell = collectionView.CellForItem (indexPath);
            cell.BackgroundColor = UIColor.Cyan;

            lastSelectedCell = cell;

            if (cell is FriendsPuzzleListCellViewController) {
            //				var friendsCell = cell as FriendsPuzzleListCellViewController;
            //				var puzzle = puzzlesWitHFriends [indexPath.Item - 1];

            } else if (cell is FriendsPuzzleListNewCellViewController) {

                var vc = this.Storyboard.InstantiateViewController("MenuCreateViewController") as MenuCreateViewController;
                vc.IsFriendMatch = true;

                NavigationController.PushViewController(
                    vc,
                    true
                    );
            }
        }
开发者ID:valryon,项目名称:pixpuzzle,代码行数:26,代码来源:FriendsPuzzleListViewController.cs


示例2: GetItemsCount

 public override int GetItemsCount(UICollectionView collectionView, int section)
 {
     if (section == 0)
         return Team1.Count;
     else
         return Team2.Count;
 }
开发者ID:GSerjo,项目名称:CVLayoutsDemo,代码行数:7,代码来源:BaseballPlayerController.cs


示例3: GetCell

        public override UICollectionViewCell GetCell(UICollectionView collectionView, Foundation.NSIndexPath indexPath)
        {
            var cell = (ListingImageCell)collectionView.DequeueReusableCell(CellID, indexPath);
            cell.Image = urls[indexPath.Row];

            return cell;
        }
开发者ID:erdennis13,项目名称:EthansList,代码行数:7,代码来源:ImageCollectionViewSource.cs


示例4: GetCell

 public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
 {
     var cell = collectionView.DequeueReusableCell(ToolCell.Key, indexPath) as ToolCell;
     cell.Text = AvailableTools[indexPath.Item].Name;
     cell.SetBorder();
     return cell;
 }
开发者ID:reactiveui-forks,项目名称:VirtualSales,代码行数:7,代码来源:AvailableToolsViewController.cs


示例5: GetCell

        public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
        {
            DBError err;
            PhotoCell cell = (PhotoCell)collectionView.DequeueReusableCell(PhotoCell.Key, indexPath);

            DBPath path = Photos [Photos.Length - indexPath.Row - 1].Path;
            DBFile file = DBFilesystem.SharedFilesystem.OpenFile (path, out err);
            UIImage image = null;

            // This means the file doesn't exist, or it is open with asynchronous operation.
            if (file == null) {
                cell.Content = null;
                return cell;
            }

            if (file.Status.Cached) {
                image = new UIImage (file.ReadData (out err));
                file.Close ();
            } else {
                file.AddObserver (this, () => {
                    DBFileStatus newStatus = file.NewerStatus;

                    if ((newStatus == null && file.Status.Cached) ||
                        (newStatus != null && newStatus.Cached)) {
                        image = new UIImage (file.ReadData (out err));
                        cell.Content = image;
                        file.RemoveObserver(this);
                        file.Close ();
                    }
                });
            }
            cell.Content = image;

            return cell;
        }
开发者ID:WaDAMake,项目名称:CloudPrint,代码行数:35,代码来源:CameraSyncViewController.cs


示例6: MoveItem

		public override void MoveItem (UICollectionView collectionView, NSIndexPath sourceIndexPath, NSIndexPath destinationIndexPath)
		{
			// Reorder our list of items
			var item = Numbers [(int)sourceIndexPath.Item];
			Numbers.RemoveAt ((int)sourceIndexPath.Item);
			Numbers.Insert ((int)destinationIndexPath.Item, item);
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:WaterfallCollectionSource.cs


示例7: GetItemsCount

 public override nint GetItemsCount(UICollectionView collectionView, nint section)
 {
     if ((dateList == null) || (dateList.Count == 0))
         return (nint)0;
     else
         return (nint)dateList.Count;
 }
开发者ID:LettuceDate,项目名称:LettuceMobile,代码行数:7,代码来源:DateCollectionSource.cs


示例8: GetSizeForItem

		public override CoreGraphics.CGSize GetSizeForItem (UICollectionView collectionView, UICollectionViewLayout layout, Foundation.NSIndexPath indexPath)
		{
			if (Master.MaxHeight != 0) {
				return new CoreGraphics.CGSize ((Master.View.Frame.Size.Width - 10) / 3, Master.MaxHeight);
			}
			return new CoreGraphics.CGSize ((Master.View.Frame.Size.Width - padding - 10) / 3, (Master.View.Frame.Size.Width - padding - 10) / 3 + differential);
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:7,代码来源:UserFeedCollectionViewDelegateFlowLayout.cs


示例9: GetViewForSupplementaryElement

        public override UICollectionReusableView GetViewForSupplementaryElement(UICollectionView collectionView, NSString elementKind, NSIndexPath indexPath)
        {
            if (elementKind == (NSString)"UICollectionElementKindSectionHeader") {
                PictureHeaderVIew header = (PictureHeaderVIew)collectionView.DequeueReusableSupplementaryView
                    (UICollectionElementKindSection.Header, (NSString)"header", indexPath);
                header.title.Frame = new RectangleF (20, 15, 230, 300);
                header.title.Text = Items.Title;
                header.title.Lines = 0;
                header.title.SizeToFit ();
                header.photo.Image = UIImage.FromFile ("./Assets/photo.png");
                header.picturesCount.Text = Items.Images.Count.ToString();

                return header;
            }
            else {
                StartReadingView footer = (StartReadingView)collectionView.DequeueReusableSupplementaryView
                    (UICollectionElementKindSection.Footer, (NSString)"collectionfooter", indexPath);
                footer.StartReading.SetBackgroundImage (UIImage.FromFile ("./Assets/buttonlong.png"), UIControlState.Normal);
                footer.StartReading.TouchUpInside += (object sender, EventArgs e) => {
                    UIStoryboard board = UIStoryboard.FromName ("MainStoryboard", null);
                    var prefs = (PreferencesSubController)board.InstantiateViewController ("preferencessub");
                    this.NavigationController.PushViewController(prefs, true);
                };
                return footer;
            }
        }
开发者ID:jgrozdanov,项目名称:mono-sport,代码行数:26,代码来源:PicturesCollectionController.cs


示例10: GetCell

		public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath)
		{
			var cell = (ProductCell)collectionView.DequeueReusableCell (reuseIdentifier, indexPath);
			ConfigureCell (cell, Products [indexPath.Row]);

			return cell;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:CatalogCollectionViewController.cs


示例11: NumberOfSections

		public override nint NumberOfSections (UICollectionView collectionView)
		{
			if (Master.CollectionItems == null || Master.CollectionItems.Count == 0) {
				return 0;
			}
			return 1;
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:7,代码来源:UserFeedCollectionViewSource.cs


示例12: GetItemsCount

		public override int GetItemsCount (UICollectionView collectionView, int section)
		{
			if (ItemsSource == null)
				return 0;
			
			return ItemsSource.Count();
		}
开发者ID:JoanMiro,项目名称:MvxMod,代码行数:7,代码来源:MvxBindableCollectionViewSource.cs


示例13: ItemSelected

 public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
 {
     var photoController = new PhotoViewController {
         Asset = (PHAsset)fetchResults[indexPath.Item]
     };
     NavigationController.PushViewController (photoController, true);
 }
开发者ID:maxpavlov,项目名称:PhotoKitDemo,代码行数:7,代码来源:PhotosViewController.cs


示例14: GetCell

 public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
 {
     var cell = (PictureBigCollectionCell)collectionView.DequeueReusableCell (PictureBigCollectionCell.CellId, indexPath);
     cell.resetScale ();
     AppDelegate.MakeImageFromURL (cell.Image, Items.Images [indexPath.Row]);
     return cell;
 }
开发者ID:jgrozdanov,项目名称:mono-sport,代码行数:7,代码来源:PictureBigCollectionController.cs


示例15: GetViewForSupplementaryElement

		// TODO: Step 2c: uncomment to get a header instance to use for the Supplementary View
		public override UICollectionReusableView GetViewForSupplementaryElement (UICollectionView collectionView, NSString elementKind, NSIndexPath indexPath)
		{
			// get a Header instance to use for the supplementary view
			var headerView = (Header)collectionView.DequeueReusableSupplementaryView (elementKind, headerId, indexPath);
			headerView.Text = "Evolve Speakers";
			return headerView;
		}
开发者ID:CodeMangler,项目名称:XamarinUniversity,代码行数:8,代码来源:CollectionViewController.cs


示例16: GetCell

		public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath)
		{
			SearchCollectionCell cell = (SearchCollectionCell)collectionView.DequeueReusableCell (identifer, indexPath);
			cell.movie = filterData [indexPath.Row];
			cell.UpdateCell ();
			return cell;
		}
开发者ID:eternaltung,项目名称:RottenTomatoes-Xamarin.iOS,代码行数:7,代码来源:SearchCollectionView.cs


示例17: ItemSelected

		public override void ItemSelected (UICollectionView collectionView, NSIndexPath indexPath) {
			if (this.movies != null && this.movies.Count > indexPath.Row) {
				var cell = this.GetCell (collectionView, indexPath) as MovieCollectionViewCell;
				cell.Selected = true;
				collectionView.CollectionViewLayout.InvalidateLayout ();
				this.OnMovieSelected (this.movies [indexPath.Row]);
			}
		}
开发者ID:RobertAltland,项目名称:MovieExplorer,代码行数:8,代码来源:MovieCollectionViewSource.cs


示例18: GetCell

		public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath)
		{
			// Get a reusable cell and set it's title from the item
			var cell = collectionView.DequeueReusableCell ("Cell", indexPath) as TextCollectionViewCell;
			cell.Title = Numbers [(int)indexPath.Item].ToString();

			return cell;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:8,代码来源:WaterfallCollectionSource.cs


示例19: GetCell

		public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath)
		{
			var cell = (PagePreview)collectionView.DequeueReusableCell (cellName, indexPath);

			cell.Page = pages.ElementAt (indexPath.Row);

			return cell;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:8,代码来源:MasterViewController.cs


示例20: ItemSelected

        public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var item = GetItemAt(indexPath);

            var command = SelectionChangedCommand;
            if (command != null)
                command.Execute(item);
        }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:8,代码来源:MvxBaseCollectionViewSource.cs



注:本文中的UICollectionView类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIColor类代码示例发布时间:2022-05-24
下一篇:
C# UICamera类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap