By default, SwiftUI place views only inside the safe area. Here is the example showing that. But we can change this behavior using the ignoresSafeArea view modifier. The ignoresSafeArea view modifier expands the view and fills the space by ignoring the safe area.
You can disable safe area layout guide from storyboard for particular view controller. Select View Controller -> File Inspector (first tab) -> Use safe area layout guides (uncheck the checkbox).
However, what if we wanted to ignore a specific edge or edges, and not all of them? By setting the . bottom value as the second argument in the above modifier, only the bottom edge is ignored.
The safe area of a view reflects the area not covered by navigation bars, tab bars, toolbars, and other ancestors that obscure a view controller's view. (In tvOS, the safe area reflects the area not covered by the screen's bezel.)
I am developing a screen using SwiftUI, want to display my view in the top safe area of the screen, is there any method to achieve this in SwiftUI?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With