From 4d900dfec6837c4a6933698adeb83bbef5a074ac Mon Sep 17 00:00:00 2001 From: wangdl Date: Sat, 30 May 2026 09:00:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(ios):=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E4=BD=93=E7=B3=BB=20+=20=E5=AD=A6=E4=B9=A0?= =?UTF-8?q?=20Tab=20=E5=9B=BE=E6=A0=87=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 shared-assets/icons/tab-learn.svg(SVG源文件) - 新增 Assets.xcassets/Icons/tab-learn.imageset(Template Image) - 新增 ZhiXiIcon 统一图标枚举 - ContentView 学习 Tab 从 systemImage: flame 改为自定义图标 Co-Authored-By: Claude Opus 4.7 --- .../Icons/tab-learn.imageset/Contents.json | 15 ++++++++++++++ .../Icons/tab-learn.imageset/tab-learn.svg | 1 + AIStudyApp/AIStudyApp/ContentView.swift | 2 +- .../Core/DesignSystem/ZhiXiIcon.swift | 20 +++++++++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/Contents.json create mode 100644 AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/tab-learn.svg create mode 100644 AIStudyApp/AIStudyApp/Core/DesignSystem/ZhiXiIcon.swift 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) + } +}