一行代码解决: .background(Color(UIColor.systemGray6).ignoresSafeArea()) .ignoresSafeArea()插入到颜色里面,整个背景颜色都会改变。