セーフエリアを無視して画面いっぱいにViewを表示するには、ignoresSafeArea
モディファイアを使用します。
このモディファイアは、指定されたエッジのセーフエリアを無視して、ビューを全画面に拡張します。
目次
サンプルコード
import SwiftUI
struct ContentView: View {
var body: some View {
ZStack{
Color.blue
}
.ignoresSafeArea()
}
}
#Preview{
ContentView()
}
ignoresSafeArea なし
![](https://seeds-digital.com/wp-content/uploads/2023/11/fb0f5c521518be7cca4042b70a29999b-507x1024.png)
.ignoresSafeArea あり
![](https://seeds-digital.com/wp-content/uploads/2023/11/4146a55a8b589ad659ed7c8092f9168b-509x1024.png)
Comment