<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIToolbar/shadowImage(forToolbarPosition:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIToolbar(im)shadowImageForToolbarPosition:"
  },
  "title" : "shadowImage(forToolbarPosition:)"
}
-->

# shadowImage(forToolbarPosition:)

Returns the image to use for the toolbar shadow in a given position.

```
func shadowImage(forToolbarPosition topOrBottom: UIBarPosition) -> UIImage?
```

## Parameters

`topOrBottom`

A toolbar position constant. You can use this parameter to indicate whether the shadow image returned is intended for use in a toolbar at the top or bottom of the view.

## Return Value

The image to use for the toolbar shadow in the position specified by `topOrBottom`.

## Discussion

The default value is `nil`, which corresponds to the default shadow image being used. When non-`nil`, the return value represents the shadow that is used on the toolbar in the position specified by the `topOrBottom` parameter.

---

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)