feat(ios): 自定义图标体系 + 学习 Tab 图标替换
- 新增 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 <noreply@anthropic.com>
This commit is contained in:
parent
850e38d1a4
commit
4d900dfec6
15
AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/Contents.json
vendored
Normal file
15
AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "tab-learn.svg",
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
},
|
||||
"properties" : {
|
||||
"template-rendering-intent" : "template"
|
||||
}
|
||||
}
|
||||
1
AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/tab-learn.svg
vendored
Normal file
1
AIStudyApp/AIStudyApp/Assets.xcassets/Icons/tab-learn.imageset/tab-learn.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M3.25 7.5C3.25 4.6005 5.60051 2.25 8.5 2.25L14.5 2.25C17.3995 2.25 19.75 4.6005 19.75 7.5L19.75 16.5C19.75 19.3995 17.3995 21.75 14.5 21.75L8.5 21.75C5.60051 21.75 3.25 19.3995 3.25 16.5L3.25 7.5ZM8.5 3.75C6.42893 3.75 4.75 5.42893 4.75 7.5L4.75 16.5C4.75 18.5711 6.42893 20.25 8.5 20.25L14.5 20.25C16.5711 20.25 18.25 18.5711 18.25 16.5L18.25 7.5C18.25 5.42893 16.5711 3.75 14.5 3.75L8.5 3.75Z" fill-rule="evenodd" fill="#000000" ></path><path d="M17.5 3.75L9 3.75L9 2.25L17.5 2.25C20.3995 2.25 22.75 4.6005 22.75 7.5L22.75 16.5C22.75 19.3995 20.3995 21.75 17.5 21.75L9 21.75L9 20.25L17.5 20.25C19.5711 20.25 21.25 18.5711 21.25 16.5L21.25 7.5C21.25 5.42893 19.5711 3.75 17.5 3.75Z" fill-rule="evenodd" fill="#000000" ></path><path d="M11.25 8C11.25 7.58579 11.5858 7.25 12 7.25L16 7.25C16.4142 7.25 16.75 7.58579 16.75 8C16.75 8.41421 16.4142 8.75 16 8.75L12 8.75C11.5858 8.75 11.25 8.41421 11.25 8Z" fill-rule="evenodd" fill="#000000" ></path><path d="M2.25 8C2.25 7.58579 2.58579 7.25 3 7.25L5 7.25C5.41421 7.25 5.75 7.58579 5.75 8C5.75 8.41421 5.41421 8.75 5 8.75L3 8.75C2.58579 8.75 2.25 8.41421 2.25 8Z" fill-rule="evenodd" fill="#000000" ></path><path d="M2.25 16C2.25 15.5858 2.58579 15.25 3 15.25L5 15.25C5.41421 15.25 5.75 15.5858 5.75 16C5.75 16.4142 5.41421 16.75 5 16.75L3 16.75C2.58579 16.75 2.25 16.4142 2.25 16Z" fill-rule="evenodd" fill="#000000" ></path><path d="M11.25 12C11.25 11.5858 11.5858 11.25 12 11.25L16 11.25C16.4142 11.25 16.75 11.5858 16.75 12C16.75 12.4142 16.4142 12.75 16 12.75L12 12.75C11.5858 12.75 11.25 12.4142 11.25 12Z" fill-rule="evenodd" fill="#000000" ></path><path d="M11.25 16C11.25 15.5858 11.5858 15.25 12 15.25L16 15.25C16.4142 15.25 16.75 15.5858 16.75 16C16.75 16.4142 16.4142 16.75 16 16.75L12 16.75C11.5858 16.75 11.25 16.4142 11.25 16Z" fill-rule="evenodd" fill="#000000" ></path><path d="M10 8C10 8.55228 9.55228 9 9 9C8.44771 9 8 8.55228 8 8C8 7.44772 8.44771 7 9 7C9.55228 7 10 7.44772 10 8Z" fill="#000000" ></path><path d="M10 12C10 12.5523 9.55228 13 9 13C8.44771 13 8 12.5523 8 12C8 11.4477 8.44771 11 9 11C9.55228 11 10 11.4477 10 12Z" fill="#000000" ></path><path d="M10 16C10 16.5523 9.55228 17 9 17C8.44771 17 8 16.5523 8 16C8 15.4477 8.44771 15 9 15C9.55228 15 10 15.4477 10 16Z" fill="#000000" ></path></svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@ -51,7 +51,7 @@ struct ContentView: View {
|
||||
.background(Color.zxCanvas.ignoresSafeArea())
|
||||
}
|
||||
.tabItem {
|
||||
Label("学习", systemImage: "flame")
|
||||
Label("学习", image: "tab-learn")
|
||||
}
|
||||
.tag("study")
|
||||
|
||||
|
||||
20
AIStudyApp/AIStudyApp/Core/DesignSystem/ZhiXiIcon.swift
Normal file
20
AIStudyApp/AIStudyApp/Core/DesignSystem/ZhiXiIcon.swift
Normal file
@ -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)
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user