feat(ios): 设置/消息/搜索图标替换为自定义 SVG

- ProfileView: 铃铛→icon-notifications, 齿轮→icon-settings
- LibraryHomeView: 放大镜→icon-search
- ZhiXiIcon 枚举补全所有图标

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-05-30 09:24:24 +08:00
parent 791b863a0e
commit 5c1cb556b9
9 changed files with 21 additions and 9 deletions

View File

@ -0,0 +1 @@
{"images":[{"filename":"icon-notifications.svg","idiom":"universal"}],"info":{"author":"xcode","version":1},"properties":{"template-rendering-intent":"template","preserves-vector-representation":true}}

View 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="M9.16972 18.312C9.49563 19.571 10.6402 20.5 11.9999 20.5C13.3595 20.5 14.5041 19.571 14.83 18.312L16.2822 18.6879C15.7891 20.5925 14.0598 22 11.9999 22C9.93994 22 8.21062 20.5925 7.71759 18.6879L9.16972 18.312Z" fill-rule="evenodd" fill="#AEAEAE"></path><path d="M12 3.50461C11.5144 3.50461 11.1207 3.89828 11.1207 4.3839L11.1207 4.62881C11.1207 5.04303 10.7849 5.37881 10.3707 5.37881C9.95651 5.37881 9.62073 5.04303 9.62073 4.62881L9.62073 4.3839C9.62073 3.06985 10.686 2.00461 12 2.00461C13.3141 2.00461 14.3793 3.06985 14.3793 4.3839L14.3793 4.62881C14.3793 5.04303 14.0435 5.37881 13.6293 5.37881C13.2151 5.37881 12.8793 5.04303 12.8793 4.62881L12.8793 4.3839C12.8793 3.89828 12.4856 3.50461 12 3.50461Z" fill-rule="evenodd" fill="#AEAEAE"></path><path d="M5.4719 10.4925C5.4719 6.88689 8.3948 3.96399 12.0004 3.96399C15.606 3.96399 18.5288 6.88689 18.5288 10.4925L18.5288 11.2143C18.5288 11.676 18.6319 12.1318 18.8306 12.5484L19.9858 14.9711C20.6793 16.4257 19.9761 18.2008 18.3769 18.6723C16.631 19.187 14.0417 19.8354 12.0003 19.8354C9.95855 19.8355 7.36859 19.187 5.62239 18.6722C4.02332 18.2008 3.32026 16.4256 4.01407 14.9713L5.16987 12.5485C5.36871 12.1317 5.4719 11.6758 5.4719 11.214L5.4719 10.4925ZM12.0004 5.46399C9.22323 5.46399 6.9719 7.71531 6.9719 10.4925L6.9719 11.214C6.9719 11.8993 6.81877 12.5759 6.5237 13.1944L5.3679 15.6172C5.04725 16.2893 5.38571 17.0386 6.04652 17.2334C7.78492 17.7459 10.1934 18.3355 12.0003 18.3354C13.8067 18.3354 16.2146 17.7459 17.9528 17.2335C18.6138 17.0386 18.9524 16.2891 18.6318 15.6167L17.4767 13.194C17.1818 12.5757 17.0288 11.8993 17.0288 11.2143L17.0288 10.4925C17.0288 7.71531 14.7775 5.46399 12.0004 5.46399Z" fill-rule="evenodd" fill="#000000"></path></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1 @@
{"images":[{"filename":"icon-search.svg","idiom":"universal"}],"info":{"author":"xcode","version":1},"properties":{"template-rendering-intent":"template","preserves-vector-representation":true}}

View 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="M17.4536 17.3549C17.7465 17.0621 18.2214 17.0621 18.5143 17.355L21.7807 20.6221C22.0735 20.915 22.0735 21.3899 21.7806 21.6827C21.4876 21.9756 21.0128 21.9755 20.7199 21.6826L17.4535 18.4156C17.1606 18.1227 17.1607 17.6478 17.4536 17.3549Z" fill-rule="evenodd" fill="#AEAEAE"></path><path d="M11.4964 3.61981C7.0801 3.61981 3.5 7.19991 3.5 11.6162C3.5 16.0325 7.0801 19.6126 11.4964 19.6126C15.9127 19.6126 19.4928 16.0325 19.4928 11.6162C19.4928 7.19991 15.9127 3.61981 11.4964 3.61981ZM2 11.6162C2 6.37148 6.25167 2.11981 11.4964 2.11981C16.7411 2.11981 20.9928 6.37148 20.9928 11.6162C20.9928 16.8609 16.7411 21.1126 11.4964 21.1126C6.25167 21.1126 2 16.8609 2 11.6162Z" fill-rule="evenodd" fill="#000000"></path></svg>

After

Width:  |  Height:  |  Size: 870 B

View File

@ -0,0 +1 @@
{"images":[{"filename":"icon-settings.svg","idiom":"universal"}],"info":{"author":"xcode","version":1},"properties":{"template-rendering-intent":"template","preserves-vector-representation":true}}

View 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="M11.0351 3.5C10.6521 3.5 10.3306 3.7886 10.2894 4.16939L9.54378 4.08878L10.2894 4.16939L10.2506 4.52863C10.1516 5.44477 9.5477 6.15186 8.85512 6.55327C8.15718 6.95779 7.24792 7.12054 6.40646 6.74888L6.07485 6.60242C5.72449 6.44768 5.31382 6.58179 5.12232 6.91348L4.1564 8.58651C3.96489 8.91821 4.05408 9.34091 4.36328 9.56696L4.64268 9.77123C5.39221 10.3192 5.70746 11.1997 5.70746 12.0112C5.70746 12.8117 5.39504 13.6787 4.65627 14.2188L4.36329 14.433C4.0541 14.6591 3.9649 15.0818 4.15641 15.4135L5.12233 17.0865C5.31384 17.4182 5.72451 17.5523 6.07487 17.3976L6.37496 17.265C7.22531 16.8895 8.14405 17.0558 8.84848 17.4653C9.54561 17.8705 10.1545 18.5827 10.2543 19.5059L10.2894 19.8306C10.3306 20.2114 10.6521 20.5 11.0351 20.5L12.9669 20.5C13.3499 20.5 13.6714 20.2114 13.7126 19.8306L13.7458 19.5231C13.8463 18.5937 14.4609 17.8776 15.1632 17.4711C15.8699 17.0621 16.7906 16.896 17.6429 17.2724L17.9263 17.3976C18.2767 17.5523 18.6873 17.4182 18.8788 17.0865L19.8447 15.4135C20.0363 15.0818 19.9471 14.6591 19.6379 14.433L19.3746 14.2406C18.6286 13.6952 18.3143 12.8191 18.3143 12.0112C18.3143 11.1923 18.6314 10.3028 19.3881 9.74954L19.6379 9.56696C19.9471 9.34091 20.0363 8.91821 19.8448 8.58651L18.8788 6.91348C18.6873 6.58179 18.2767 6.44768 17.9263 6.60242L17.6114 6.74153C16.768 7.11404 15.8567 6.95152 15.1565 6.5474C14.4588 6.14475 13.8493 5.43383 13.7496 4.51151L13.7126 4.16939C13.6714 3.78859 13.3499 3.5 12.9669 3.5L11.0351 3.5ZM8.79812 4.00817C8.92162 2.86579 9.88605 2 11.0351 2L12.9669 2C14.116 2 15.0804 2.86579 15.2039 4.00817L15.2409 4.35029C15.2767 4.68179 15.5117 5.02052 15.9062 5.24823C16.2953 5.47275 16.6983 5.50501 17.0053 5.3694L17.3203 5.2303C18.3714 4.76606 19.6034 5.16839 20.1779 6.16348L21.1438 7.83651C21.7183 8.83161 21.4507 10.0997 20.5232 10.7779L20.2734 10.9604C19.9937 11.1649 19.8143 11.5462 19.8143 12.0112C19.8143 12.4627 19.9893 12.8318 20.2599 13.0297L20.5231 13.2221C21.4507 13.9003 21.7183 15.1684 21.1438 16.1635L20.1779 17.8365C19.6033 18.8316 18.3713 19.2339 17.3203 18.7697L17.0368 18.6445C16.7229 18.5058 16.3113 18.5398 15.9145 18.7694C15.5133 19.0015 15.2737 19.3462 15.2371 19.6843L15.2039 19.9918C15.0804 21.1342 14.116 22 12.9669 22L11.0351 22C9.88605 22 8.92162 21.1342 8.79812 19.9918L8.76302 19.6672C8.72692 19.3332 8.49082 18.9923 8.09471 18.7621C7.70111 18.5333 7.29239 18.4996 6.98099 18.6372L6.6809 18.7697C5.62982 19.2339 4.39781 18.8316 3.8233 17.8365L2.85737 16.1635C2.28285 15.1684 2.55043 13.9003 3.47801 13.2221L3.77099 13.0079C4.03551 12.8145 4.20746 12.4535 4.20746 12.0112C4.20746 11.5553 4.03101 11.1822 3.7574 10.9821L3.478 10.7779L3.92064 10.1724L3.478 10.7779C2.55042 10.0997 2.28284 8.83161 2.85736 7.83651L3.82328 6.16348C4.3978 5.16839 5.62981 4.76606 6.68089 5.2303L7.01249 5.37676C7.31695 5.51123 7.71705 5.47915 8.10294 5.25549C8.49248 5.02972 8.7239 4.69474 8.75929 4.3674L8.79812 4.00817Z" fill-rule="evenodd" fill="#000000"></path><path d="M12.0001 9.75C10.7575 9.75 9.75012 10.7574 9.75012 12C9.75012 13.2426 10.7575 14.25 12.0001 14.25C13.2428 14.25 14.2501 13.2426 14.2501 12C14.2501 10.7574 13.2428 9.75 12.0001 9.75ZM8.25012 12C8.25012 9.92893 9.92905 8.25 12.0001 8.25C14.0712 8.25 15.7501 9.92893 15.7501 12C15.7501 14.0711 14.0712 15.75 12.0001 15.75C9.92905 15.75 8.25012 14.0711 8.25012 12Z" fill-rule="evenodd" fill="#AEAEAE"></path></svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -1,19 +1,25 @@
import SwiftUI
///
/// Android shared-assets/icons/
enum ZhiXiIcon: String {
// Tab +
case tabLearn = "tab-learn"
//
// case tabLibrary = "tab-library"
// case tabAnalysis = "tab-analysis"
// case tabProfile = "tab-profile"
case tabLearnActive = "tab-learn-active"
case tabLibrary = "tab-library"
case tabLibraryActive = "tab-library-active"
case tabAnalysis = "tab-analysis"
case tabAnalysisActive = "tab-analysis-active"
case tabProfile = "tab-profile"
case tabProfileActive = "tab-profile-active"
// Template
case iconSettings = "icon-settings"
case iconNotifications = "icon-notifications"
case iconSearch = "icon-search"
var image: Image { Image(rawValue) }
}
extension Image {
/// tintColor
static func zxIcon(_ icon: ZhiXiIcon) -> Image {
icon.image.renderingMode(.template)
}

View File

@ -12,7 +12,7 @@ struct LibraryHomeView: View {
VStack(spacing: 0) {
HStack { Text("知识库").font(.system(size: 22, weight: .heavy)).foregroundColor(Color.zxF0).tracking(-0.5); Spacer()
NavigationLink(value: Route.librarySearch) {
Image(systemName: "magnifyingglass").font(.system(size: 18)).foregroundColor(Color.zxF05)
Image("icon-search").resizable().scaledToFit().frame(width: 18, height: 18).foregroundColor(Color.zxF05)
.frame(width: 36, height: 36).background(Color(hex:"#FFFFFF",opacity:0.05))
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.zxBorder008, lineWidth: 1))

View File

@ -12,14 +12,14 @@ struct ProfileView: View {
Text("我的").font(.system(size: 22, weight: .heavy)).foregroundColor(Color.zxF0).tracking(-0.5)
Spacer()
NavigationLink(value: Route.notificationList) {
Image(systemName: "bell").font(.system(size: 18)).foregroundColor(Color.zxF05)
Image("icon-notifications").resizable().scaledToFit().frame(width: 18, height: 18).foregroundColor(Color.zxF05)
.frame(width: 36, height: 36).background(Color(hex:"#FFFFFF",opacity:0.05))
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.zxBorder008, lineWidth: 1))
}
.accessibilityLabel("通知中心")
NavigationLink(value: Route.settings) {
Image(systemName: "gearshape").font(.system(size: 18)).foregroundColor(Color.zxF05)
Image("icon-settings").resizable().scaledToFit().frame(width: 18, height: 18).foregroundColor(Color.zxF05)
.frame(width: 36, height: 36).background(Color(hex:"#FFFFFF",opacity:0.05))
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay(RoundedRectangle(cornerRadius: 10).stroke(Color.zxBorder008, lineWidth: 1))