引入统一设计令牌并迁移首页、订单和数据 UI
This commit is contained in:
28
suixinkan/Theme/AppNavigationBarAppearance.swift
Normal file
28
suixinkan/Theme/AppNavigationBarAppearance.swift
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user