<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIControl/contentHorizontalAlignment-swift.property",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIControl(py)contentHorizontalAlignment"
  },
  "title" : "contentHorizontalAlignment"
}
-->

# contentHorizontalAlignment

The horizontal alignment of content within the control’s bounds.

```
var contentHorizontalAlignment: UIControl.ContentHorizontalAlignment { get set }
```

## Parameters

`contentAlignment`

A constant that specifies the horizontal alignment of text or images within the control. For a list of possible values, see [`UIControl.ContentHorizontalAlignment`](/documentation/UIKit/UIControl/ContentHorizontalAlignment-swift.enum).

## Discussion

For controls that contain configurable text or image content, use this property to align that content appropriately inside the control’s bounds. Not all control subclasses have content that can be aligned, and it’s the responsibility of the subclass to determine how to apply this value. The default value of this property is [`UIControl.ContentHorizontalAlignment.center`](/documentation/UIKit/UIControl/ContentHorizontalAlignment-swift.enum/center).

---

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)