I have a custom segment control where i want to increase height and custom background color.
How do I customize the segment control in swiftUI?
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
I have a custom segment control where i want to increase height and custom background color.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tasadduq BurneyRank #1,427 · 1.1K reputationPosted Dec 8, 2025, 12:46 PM EST
Hey,
Hope you're keeping well.
SwiftUI’s native
SegmentedControldoesn’t expose direct height or background styling, so you’ll need to wrap it in a customPickerwith.segmentedstyle and then apply modifiers like.frame(height:)for size and.background()or.overlay()for color. For dynamic themes, bind toEnvironment(\.colorScheme)and adjust colors to meet WCAG contrast guidelines. If this were a .NET MAUI app targeting iOS, you’d achieve similar results by creating a custom handler forUISegmentedControlin the iOS-specific project, overridingBackgroundColorandHeightviaPlatformView, ensuring accessibility sizing remains intact. This keeps the styling consistent across platforms while allowing full control over UI customization.Thanks and regards,
Taz