<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureVideoPreviewLayer/videoGravity",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureVideoPreviewLayer(py)videoGravity"
  },
  "title" : "videoGravity"
}
-->

# videoGravity

A value that indicates how the layer displays video content within its bounds.

```
var videoGravity: AVLayerVideoGravity { get set }
```

## Discussion

Options are [`resizeAspect`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspect), [`resizeAspectFill`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspectFill), and [`resize`](/documentation/AVFoundation/AVLayerVideoGravity/resize). The default is [`resizeAspect`](/documentation/AVFoundation/AVLayerVideoGravity/resizeAspect).

This property is animatable.

---

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)