<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "tvOS: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIView/ContentMode-swift.enum",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIViewContentMode"
  },
  "title" : "UIView.ContentMode"
}
-->

# UIView.ContentMode

Options to specify how a view adjusts its content when its size changes.

```
enum ContentMode
```

## Topics

### Constants

[`UIViewContentModeScaleToFill`](/documentation/UIKit/UIView/ContentMode-swift.enum/scaleToFill)

The option to scale the content to fit the size of itself by changing the aspect ratio of the content if necessary.

[`UIViewContentModeScaleAspectFit`](/documentation/UIKit/UIView/ContentMode-swift.enum/scaleAspectFit)

The option to scale the content to fit the size of the view by maintaining the aspect ratio. Any remaining area of the view’s bounds is transparent.

[`UIViewContentModeScaleAspectFill`](/documentation/UIKit/UIView/ContentMode-swift.enum/scaleAspectFill)

The option to scale the content to fill the size of the view. Some portion of the content may be clipped to fill the view’s bounds.

[`UIViewContentModeRedraw`](/documentation/UIKit/UIView/ContentMode-swift.enum/redraw)

The option to redisplay the view when the bounds change by invoking the [`setNeedsDisplay()`](/documentation/UIKit/UIView/setNeedsDisplay()) method.

[`UIViewContentModeCenter`](/documentation/UIKit/UIView/ContentMode-swift.enum/center)

The option to center the content in the view’s bounds, keeping the proportions the same.

[`UIViewContentModeTop`](/documentation/UIKit/UIView/ContentMode-swift.enum/top)

The option to center the content aligned at the top in the view’s bounds.

[`UIViewContentModeBottom`](/documentation/UIKit/UIView/ContentMode-swift.enum/bottom)

The option to center the content aligned at the bottom in the view’s bounds.

[`UIViewContentModeLeft`](/documentation/UIKit/UIView/ContentMode-swift.enum/left)

The option to align the content on the left of the view.

[`UIViewContentModeRight`](/documentation/UIKit/UIView/ContentMode-swift.enum/right)

The option to align the content on the right of the view.

[`UIViewContentModeTopLeft`](/documentation/UIKit/UIView/ContentMode-swift.enum/topLeft)

The option to align the content in the top-left corner of the view.

[`UIViewContentModeTopRight`](/documentation/UIKit/UIView/ContentMode-swift.enum/topRight)

The option to align the content in the top-right corner of the view.

[`UIViewContentModeBottomLeft`](/documentation/UIKit/UIView/ContentMode-swift.enum/bottomLeft)

The option to align the content in the bottom-left corner of the view.

[`UIViewContentModeBottomRight`](/documentation/UIKit/UIView/ContentMode-swift.enum/bottomRight)

The option to align the content in the bottom-right corner of the view.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`Hashable`](/documentation/Swift/Hashable)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)