Instance Method

setWidth:

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

Declaration

- (void)setWidth:(CGFloat)width;

Parameters

width

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

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 UIViewContentModeScaleToFill.

Changes to the width of an object are animatable.

See Also

Changing an Object’s Size

- setHeight:

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

- setRelativeWidth:withAdjustment:

Sets the width of the object relative to its container.

- setRelativeHeight:withAdjustment:

Sets the height of the object relative to its container.

- sizeToFitWidth

Sets the width of the object to fit its current content.

- sizeToFitHeight

Sets the height of the object so that it fills the available vertical space.