xcode 13.3
iOS 15.4
1、状态栏隐藏和显示
/// Sets the visibility of the status bar.
/// UsestatusBar(hidden:)
to show or hide the status bar.
/// - Parameter hidden: A Boolean value that indicates whether to hide the status bar.
/// 设置状态栏的可见性。
/// 使用 “状态栏(隐藏:)” 显示或隐藏状态栏。
///- 参数隐藏:一个布尔值,指示是否隐藏状态栏。
.statusBar(hidden: true)
2、状态栏的颜色设置
/// The color scheme that corresponds to a light appearance.
/// 与灯光外观相对应的配色方案。
case light
/// The color scheme that corresponds to a dark appearance.
/// 与深色外观相对应的配色方案。
case dark
dark 会把状态栏颜色变为白色,但同时也会把你的背景变成黑色!无论你是否设置 Appearance 为 Light
.preferredColorScheme(.dark)
此处设置会导致全局变成暗黑模式,暂时尚未找到更好的方法,找到后会更新
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)