<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVLayerVideoGravity",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:@T@AVLayerVideoGravity"
  },
  "title" : "AVLayerVideoGravity"
}
-->

# AVLayerVideoGravity

A structure that defines how a layer displays a player’s visual content within the layer’s bounds.

```
struct AVLayerVideoGravity
```

## Topics

### Video gravities

[`resize`](/documentation/AVFoundation/AVLayerVideoGravity/resize)

The video stretches to fill the layer’s bounds.

[`resizeAspect`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspect)

The video preserves its aspect ratio and fits it within the layer’s bounds.

[`resizeAspectFill`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspectFill)

The video preserves its aspect ratio and fills the layer’s bounds.

### Initializers

[`init(rawValue:)`](/documentation/AVFoundation/AVLayerVideoGravity/init(rawValue:))

Creates a video gravity with a string value.



---

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)