Parameters
The safe area regions to ignore.
The edges where safe area should be ignored.
Controls how this view ignores safe area insets.
.ignoresSafeArea(regions?: SafeAreaRegions, edges?: EdgeSet): Component;
Show SafeAreaRegions Values
"container" - The safe area defined by the device container"keyboard" - The safe area defined by the keyboard"all" - All safe area regions (default)Show EdgeSet Values
"top" - Top edge"leading" - Leading edge (left in LTR, right in RTL)"bottom" - Bottom edge"trailing" - Trailing edge (right in LTR, left in RTL)"horizontal" - Leading and trailing edges"vertical" - Top and bottom edges"all" - All edges (default)["top", "bottom"]Image("background.jpg")
.ignoresSafeArea()
Rectangle()
.fill(Color("blue"))
.ignoresSafeArea("all", "top")
const [message, setMessage] = useState("")
VStack([
Spacer(),
TextField({ placeholder: "Enter message", text: message, setText: setMessage }),
Button("Send", () => {})
]).ignoresSafeArea("keyboard")
ZStack([
// Background ignores all safe areas
LinearGradient({
colors: [Color("purple"), Color("pink")],
startPoint: "topLeading",
endPoint: "bottomTrailing"
}).ignoresSafeArea(),
// Content respects safe areas
VStack([
Text("Title"),
Text("Content")
])
])
ScrollView([
Text("Content that extends to screen edges")
]).ignoresSafeArea("container", ["leading", "trailing"])
VStack([
// Header extends under status bar
Rectangle()
.fill(Color("blue"))
.frame(height: 100)
.ignoresSafeArea("container", "top"),
// Body content respects safe area
Text("Main content")
])