29 lines
900 B
Swift
29 lines
900 B
Swift
//
|
|
// AppNavigationBarAppearance.swift
|
|
// suixinkan
|
|
//
|
|
|
|
import UIKit
|
|
|
|
/// 全局 UINavigationBar 外观配置。
|
|
enum AppNavigationBarAppearance {
|
|
|
|
/// 应用标准导航栏样式(白底、无 shadow、主色标题)。
|
|
static func applyGlobalAppearance() {
|
|
let appearance = UINavigationBarAppearance()
|
|
appearance.configureWithOpaqueBackground()
|
|
appearance.backgroundColor = AppColor.cardBackground
|
|
appearance.shadowColor = .clear
|
|
appearance.titleTextAttributes = [
|
|
.foregroundColor: AppColor.textPrimary,
|
|
.font: UIFont.app(.title),
|
|
]
|
|
|
|
let navigationBar = UINavigationBar.appearance()
|
|
navigationBar.standardAppearance = appearance
|
|
navigationBar.scrollEdgeAppearance = appearance
|
|
navigationBar.compactAppearance = appearance
|
|
navigationBar.tintColor = AppColor.primary
|
|
}
|
|
}
|