How to get orientation in ActivityConfiguration compactLeading

I'm building an App, that is drawing power values in the Dynamic Island area. So the primary indicator is a circle presenting the charge.

I've noticed the first issue with this in the landscape orientation, that it then gets clipped by the camera. So I've moved it a few pixels up, which also makes it look really snug with equal distance to the upper outline of the layout.

However this then causes issues, when my app gets pushed into the minimal detached position. This is the same view and I can't seem to differentiate, which is which. So either I offset the camera and clip in the detached island or i render perfectly there and clip the camera.

iOS 27 added isDynamicIslandLimitedInWidth, which sounds like the right indicator, but what's there before?

I've tried measuring the area to get any indication, but it's equal in all regards. Did anyone solve this?


Answered by Pokpong in 911489022

I would avoid using a vertical pixel offset to detect the camera or whether the minimal view is attached or detached. The system chooses those presentations, and the minimal closure is the same view in either placement, so there isn’t a reliable detached flag to branch on.

For the compact leading view, use the new isDynamicIslandLimitedInWidth environment value to switch to a simpler layout when width is constrained. Apple’s docs say it applies to compactLeading, compactTrailing, and minimal: https://developer.apple.com/documentation/swiftui/environmentvalues/isdynamicislandlimitedinwidth

Keep the minimal presentation centered and sized to fit its available shape, and make the circle itself smaller or simpler when the width is limited instead of shifting it to compensate for the camera. The Live Activities essentials session also discusses the landscape constraint in iOS 27: https://developer.apple.com/videos/wwdc2026/223/

Accepted Answer

I would avoid using a vertical pixel offset to detect the camera or whether the minimal view is attached or detached. The system chooses those presentations, and the minimal closure is the same view in either placement, so there isn’t a reliable detached flag to branch on.

For the compact leading view, use the new isDynamicIslandLimitedInWidth environment value to switch to a simpler layout when width is constrained. Apple’s docs say it applies to compactLeading, compactTrailing, and minimal: https://developer.apple.com/documentation/swiftui/environmentvalues/isdynamicislandlimitedinwidth

Keep the minimal presentation centered and sized to fit its available shape, and make the circle itself smaller or simpler when the width is limited instead of shifting it to compensate for the camera. The Live Activities essentials session also discusses the landscape constraint in iOS 27: https://developer.apple.com/videos/wwdc2026/223/

Yeah, that's likely the only option, as isDynamicIslandLimitedInWidth was only added in iOS 27 and I'd like to stay with a lower compatibility for the moment. I thought, maybe I'm missing some indicator which I could use. I'll revisit this in a year then :D Thank you.