当前位置: 首页>>代码示例>>C#>>正文


C# UICollectionView.CellForItem方法代码示例

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


在下文中一共展示了UICollectionView.CellForItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ItemDeselected

        public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var cell = collectionView.CellForItem (indexPath) as PuzzlesListCellViewController;

            cell.UnsetSelected ();

            MenuPlayViewController menu = ParentViewController as MenuPlayViewController;
            menu.SetSelectedPuzzle (null);
        }
开发者ID:valryon,项目名称:pixpuzzle,代码行数:9,代码来源:PuzzleListViewController.cs

示例3: ItemDeselected

        public override void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var cell = collectionView.CellForItem (indexPath);
            cell.BackgroundColor = UIColor.Clear;

            if (cell is FriendsPuzzleListCellViewController) {
            //				var friendsCell = cell as FriendsPuzzleListCellViewController;
            //				var puzzle = puzzlesWitHFriends [indexPath.Item - 1];
            }
        }
开发者ID:valryon,项目名称:pixpuzzle,代码行数:10,代码来源:FriendsPuzzleListViewController.cs

示例4: ItemSelected

        public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            lastSelectedCell.UnsetSelected ();

            var cell = collectionView.CellForItem (indexPath) as PuzzlesListCellViewController;
            lastSelectedCell = cell;
            cell.SetSelected ();

            var puzzle = GetPuzzleForPath (indexPath);

            MenuPlayViewController menu = ParentViewController as MenuPlayViewController;
            menu.SetSelectedPuzzle (puzzle);
        }
开发者ID:valryon,项目名称:pixpuzzle,代码行数:13,代码来源:PuzzleListViewController.cs

示例5: ItemHighlighted

		// TODO: Step 3a: uncomment to enable highlighting during a touch and unhighlight on touch up
		public override void ItemHighlighted (UICollectionView collectionView, NSIndexPath indexPath)
		{
			UICollectionViewCell cell = collectionView.CellForItem (indexPath);

			// animate the cell to scale up when highlighted
			UIView.Animate (
				duration: 0.2, 
				animation: () => { 
					cell.ContentView.Transform = CGAffineTransform.MakeScale (1.1f, 1.1f);
					cell.BackgroundView.Transform = CGAffineTransform.MakeScale (1.4f, 1.4f);
					cell.BackgroundView.BackgroundColor = UIColor.Purple;
					cell.Layer.ZPosition = ++cellZIndex;
				}
			);
		}
开发者ID:CodeMangler,项目名称:XamarinUniversity,代码行数:16,代码来源:CollectionViewController.cs

示例6: ItemSelected

        public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var tile = (TileCellView)collectionView.CellForItem (indexPath);
            var updateTiles = _tileGrid.Click (tile.Tile);
            tile.Update ();
            tile.Layer.BorderColor = tile.Tile.IsPlayerRed? UIColor.Red.CGColor:UIColor.Blue.CGColor;
            tile.Layer.BorderWidth = 4.0f;

            if (updateTiles != null)
            {
                foreach (var item in updateTiles) {
                    var updateTile = (TileCellView)CollectionView.CellForItem (NSIndexPath.FromRowSection(item, 0));
                    updateTile.Update ();
                }
            }

            CheckWinning ();
            _headerView.Update ();
        }
开发者ID:CarriePlaced,项目名称:Minesweeper,代码行数:19,代码来源:GameGridView.cs

示例7: ItemUnhighlighted

		public override void ItemUnhighlighted (UICollectionView collectionView, NSIndexPath indexPath)
		{
			var cell = collectionView.CellForItem (indexPath);
			cell.ContentView.BackgroundColor = UIColor.White;
		}
开发者ID:mabhi,项目名称:crossdevicepoc,代码行数:5,代码来源:ProductCollectionViewController.cs

示例8: CellForItem

 internal UICollectionViewCell CellForItem(UICollectionView view, NSIndexPath path)
 {
     if (path == null)
         return null;
     UICollectionViewCell cell = view.CellForItem(path);
     if (cell != null)
         return cell;
     if (_lastCreatedCellPath != null && path.Equals(_lastCreatedCellPath))
         return _lastCreatedCell;
     return null;
 }
开发者ID:windygu,项目名称:MugenMvvmToolkit,代码行数:11,代码来源:CollectionViewSourceBase.cs

示例9: ItemUnhighlighted

        public override void ItemUnhighlighted(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var cell = (CategoryCell)collectionView.CellForItem(indexPath);
            cell.ImageView.Alpha = 1;

            CategoryEntity row = Rows[indexPath.Row];
            row.Tapped.Invoke();
        }
开发者ID:dsb92,项目名称:patientcare,代码行数:8,代码来源:CategorySource.cs

示例10: ItemHighlighted

 public override void ItemHighlighted(UICollectionView collectionView, NSIndexPath indexPath)
 {
     var cell = (CategoryCell)collectionView.CellForItem(indexPath);
     cell.ImageView.Alpha = 0.5f;
 }
开发者ID:dsb92,项目名称:patientcare,代码行数:5,代码来源:CategorySource.cs

示例11: ItemSelected

        public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            selectedFilterName = availableFilterInfos [indexPath.Item].FilterName;
            UpdateFilter ();

            UpdateSelectionForCell (collectionView.CellForItem (indexPath));

            UpdateFilterPreview ();
        }
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:9,代码来源:PhotoEditingViewController.cs

示例12: ItemDeselected

 public void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
 {
     UpdateSelectionForCell (collectionView.CellForItem (indexPath));
 }
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:4,代码来源:PhotoEditingViewController.cs

示例13: ItemHighlighted

 public override void ItemHighlighted(UICollectionView collectionView, Foundation.NSIndexPath indexPath)
 {
     var cell = collectionView.CellForItem (indexPath);
     cell.ContentView.BackgroundColor = UIColor.FromRGB(0x34,0x98,0xDB).ColorWithAlpha(0xcc);
 }
开发者ID:phantomlight,项目名称:xamarin-ios-samples,代码行数:5,代码来源:CollectionViewHelper.cs

示例14: ItemSelected

 public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
 {
     UICollectionViewCell cell = collectionView.CellForItem (indexPath);
     cell.BackgroundColor = UIColor.Green;
 }
开发者ID:NashXam,项目名称:minesweeper,代码行数:5,代码来源:MSGameBoardViewControllerController.cs

示例15: ItemUnhighlighted

		public override void ItemUnhighlighted (UICollectionView collectionView, NSIndexPath indexPath)
		{
			// Get cell and return to blue background
			var cell = collectionView.CellForItem(indexPath);
			cell.ContentView.BackgroundColor = UIColor.FromRGB(164,205,255);
		}
开发者ID:rmalpacon101,项目名称:monotouch-samples,代码行数:6,代码来源:WaterfallCollectionDelegate.cs


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