Overloads
2 ways to call compose().ignoresSafeArea(). Each is one SwiftUI overload, picked by the arguments you pass.
compose().ignoresSafeArea(
regions?: SwiftUI.SafeAreaRegions,
options?: {
edges?: SwiftUI.EdgeSet;
}
)nonisolated func ignoresSafeArea(
_ regions: SafeAreaRegions = .all,
edges: Edge.Set = .all
) -> some ViewParameters
regionsSwiftUI.SafeAreaRegionsThe regions to expand the view's safe area into. The modifier expands into all safe area region types by default.
options.edgesSwiftUI.EdgeSetThe set of edges to expand. Any edges that you don't include in this set remain unchanged. The set includes all edges by default.
Return value
A view with an expanded safe area.
Discussion
By default, the SwiftUI layout system sizes and positions views to avoid certain safe areas. This ensures that system content like the software keyboard or edges of the device don’t obstruct your views. To extend your content into these regions, you can ignore safe areas on specific edges by applying this modifier.
When expanding the safe area, the SwiftUI layout system proposes the expanded size to the view. If your view has a fixed size, the alignment of the view may not be what you expect.
By default, SwiftUI resolves the alignment based on the
edges being ignored. For example, providing only the bottom
edge will result in a bottom alignment being used. You can use
the View.ignoresSafeArea(_:alignment:) modifier to
explicitly configure the alignment.
For examples of how to use this modifier, see doc:Adding-a-Background-to-Your-View.
See also
More in Layout.
- alignmentGuideSets the view's vertical alignment.
- aspectRatioConstrains this view's dimensions to the specified aspect ratio.
- containerCornerOffsetAdjusts the view's layout to avoid the container view's corner insets for the specified edges.
- containerRelativeFramePositions this view within an invisible frame with a size relative to the nearest container.
- controlSizeSets the size for controls within this view.
- defaultScrollAnchorAssociates an anchor to control which part of the scroll view's content should be rendered by default.
- dynamicTypeSizeSets the Dynamic Type size within the view to the given value.
- fixedSizeFixes this view at its ideal size.
- flipsForRightToLeftLayoutDirectionSets whether this view mirrors its contents horizontally when the layout direction is right-to-left.
- framePositions this view within an invisible frame.
- geometryGroupIsolates the geometry (e.g. position and size) of the view from its parent view.
- gridCellAnchorSpecifies a custom alignment anchor for a view that acts as a grid cell.