diff --git a/AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/Contents.json b/AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/Contents.json new file mode 100644 index 0000000..4f99d71 --- /dev/null +++ b/AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "tab-learn.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/tab-learn.svg b/AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/tab-learn.svg new file mode 100644 index 0000000..be50f58 --- /dev/null +++ b/AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/tab-learn.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/AIStudyApp/AIStudyApp/ContentView.swift b/AIStudyApp/AIStudyApp/ContentView.swift index 170ab23..1bd241e 100644 --- a/AIStudyApp/AIStudyApp/ContentView.swift +++ b/AIStudyApp/AIStudyApp/ContentView.swift @@ -51,7 +51,7 @@ struct ContentView: View { .background(Color.zxCanvas.ignoresSafeArea()) } .tabItem { - Label("学习", systemImage: "flame") + Label("学习", image: "tab-learn") } .tag("study") diff --git a/AIStudyApp/AIStudyApp/Core/DesignSystem/ZhiXiIcon.swift b/AIStudyApp/AIStudyApp/Core/DesignSystem/ZhiXiIcon.swift new file mode 100644 index 0000000..e00ae86 --- /dev/null +++ b/AIStudyApp/AIStudyApp/Core/DesignSystem/ZhiXiIcon.swift @@ -0,0 +1,20 @@ +import SwiftUI + +/// 统一图标组件 — 所有自定义图标在此管理 +/// 后续 Android 对应资源放在 shared-assets/icons/ +enum ZhiXiIcon: String { + case tabLearn = "tab-learn" + // 待补充: + // case tabLibrary = "tab-library" + // case tabAnalysis = "tab-analysis" + // case tabProfile = "tab-profile" + + var image: Image { Image(rawValue) } +} + +extension Image { + /// 自定义图标(模板渲染,支持 tintColor) + static func zxIcon(_ icon: ZhiXiIcon) -> Image { + icon.image.renderingMode(.template) + } +}