---
title: "setContentOffset(_:forSegmentAt:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisegmentedcontrol/setcontentoffset(_:forsegmentat:)"
---

# setContentOffset(_:forSegmentAt:)

Adjusts the offset for drawing the content (image or text) of the specified segment.

## Declaration

```swift
func setContentOffset(_ offset: CGSize, forSegmentAt segment: Int)
```

## Parameters

- `offset`: The offset (as a doc://com.apple.documentation/documentation/CoreFoundation/CGSize type) from the origin of the segment at which to draw the segment’s content. The default offset is (0,0).
- `segment`: An index number identifying a segment in the control. It must be a number between 0 and the number of segments (doc://com.apple.uikit/documentation/UIKit/UISegmentedControl/numberOfSegments) minus 1; the segmented control pins values exceeding this upper range to the last segment.

## See Also

### Managing segment behavior and appearance

- [isMomentary](uikit/uisegmentedcontrol/ismomentary.md)
- [setEnabled(_:forSegmentAt:)](uikit/uisegmentedcontrol/setenabled(_:forsegmentat:).md)
- [isEnabledForSegment(at:)](uikit/uisegmentedcontrol/isenabledforsegment(at:).md)
- [contentOffsetForSegment(at:)](uikit/uisegmentedcontrol/contentoffsetforsegment(at:).md)
- [setWidth(_:forSegmentAt:)](uikit/uisegmentedcontrol/setwidth(_:forsegmentat:).md)
- [widthForSegment(at:)](uikit/uisegmentedcontrol/widthforsegment(at:).md)
- [apportionsSegmentWidthsByContent](uikit/uisegmentedcontrol/apportionssegmentwidthsbycontent.md)
