<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UICollectionViewLayout/layoutAttributesForDecorationView(ofKind:at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UICollectionViewLayout(im)layoutAttributesForDecorationViewOfKind:atIndexPath:"
  },
  "title" : "layoutAttributesForDecorationView(ofKind:at:)"
}
-->

# layoutAttributesForDecorationView(ofKind:at:)

Retrieves the layout attributes for the specified decoration view.

```
func layoutAttributesForDecorationView(ofKind elementKind: String, at indexPath: IndexPath) -> UICollectionViewLayoutAttributes?
```

## Parameters

`elementKind`

A string that identifies the type of the decoration view.

`indexPath`

The index path of the decoration view.

## Return Value

A layout attributes object containing the information to apply to the decoration view.

## Discussion

If your layout object defines any decoration views, you must override this method and use it to return layout information for those views.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)