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

# setWidth(_:)

Sets the absolute width (in points) of the object.

## Declaration

```swift
func setWidth(_ width: CGFloat)
```

## Parameters

- `width`: The new width of the object. Specifying a value of 0.0 causes the item to have no width.

## Discussion

Discussion You cannot use this method to alter the width of tables or the thickness of vertical separator items. Changing the width of a WKInterfaceImage object causes the image’s content scaling mode to change to UIView.ContentMode.scaleToFill. Changes to the width of an object are animatable.

## See Also

### Changing an Object’s Size

- [setHeight(_:)](watchkit/wkinterfaceobject/setheight(_:).md)
- [setRelativeWidth(_:withAdjustment:)](watchkit/wkinterfaceobject/setrelativewidth(_:withadjustment:).md)
- [setRelativeHeight(_:withAdjustment:)](watchkit/wkinterfaceobject/setrelativeheight(_:withadjustment:).md)
- [sizeToFitWidth()](watchkit/wkinterfaceobject/sizetofitwidth().md)
- [sizeToFitHeight()](watchkit/wkinterfaceobject/sizetofitheight().md)
