<!--
{
  "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/UISegmentedControl/setContentOffset(_:forSegmentAt:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISegmentedControl(im)setContentOffset:forSegmentAtIndex:"
  },
  "title" : "setContentOffset(_:forSegmentAt:)"
}
-->

# setContentOffset(_:forSegmentAt:)

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

```
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 ([`numberOfSegments`](/documentation/UIKit/UISegmentedControl/numberOfSegments)) minus 1; the segmented control pins values exceeding this upper range to the last segment.

---

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)