本文整理汇总了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
);
}
}
示例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);
}
示例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];
}
}
示例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);
}
示例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;
}
);
}
示例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 ();
}
示例7: ItemUnhighlighted
public override void ItemUnhighlighted (UICollectionView collectionView, NSIndexPath indexPath)
{
var cell = collectionView.CellForItem (indexPath);
cell.ContentView.BackgroundColor = UIColor.White;
}
示例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;
}
示例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();
}
示例10: ItemHighlighted
public override void ItemHighlighted(UICollectionView collectionView, NSIndexPath indexPath)
{
var cell = (CategoryCell)collectionView.CellForItem(indexPath);
cell.ImageView.Alpha = 0.5f;
}
示例11: ItemSelected
public void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
{
selectedFilterName = availableFilterInfos [indexPath.Item].FilterName;
UpdateFilter ();
UpdateSelectionForCell (collectionView.CellForItem (indexPath));
UpdateFilterPreview ();
}
示例12: ItemDeselected
public void ItemDeselected(UICollectionView collectionView, NSIndexPath indexPath)
{
UpdateSelectionForCell (collectionView.CellForItem (indexPath));
}
示例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);
}
示例14: ItemSelected
public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
{
UICollectionViewCell cell = collectionView.CellForItem (indexPath);
cell.BackgroundColor = UIColor.Green;
}
示例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);
}