Establish AppColor/AppFont/AppSpacing/AppRadius theming, shared components, and design-system docs so pilot screens align with Android while keeping iOS-native spacing and touch targets. Co-authored-by: Cursor <cursoragent@cursor.com>
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
|
||
}
|
||
}
|