---
title: "setHorizontalAlignment(_:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfaceobject/sethorizontalalignment(_:)"
---

# setHorizontalAlignment(_:)

Sets the horizontal alignment of an object relative to its container’s bounds.

## Declaration

```swift
func setHorizontalAlignment(_ horizontalAlignment: WKInterfaceObjectHorizontalAlignment)
```

## Parameters

- `horizontalAlignment`: The horizontal alignment of the object.

## Discussion

Discussion Changes to the horizontal alignment of an object are animatable.

## See Also

### Setting an Object’s Alignment

- [setVerticalAlignment(_:)](watchkit/wkinterfaceobject/setverticalalignment(_:).md)
