PythonIDE Docs
中文
简体中文

附录: SF Symbols 速查

Image、Label、Menu 中使用系统符号。

SF Symbols 与 appui.Image(system_name=...)appui.Label(title, system_image=...) 配合使用。下列名称均来自公开符号集(实际可用性随 iOS 版本略有差异;若单个符号缺失,请替换为同义图标)。

#按类别速览(100+)

#导航与结构

chevron.left, chevron.right, chevron.up, chevron.down, chevron.compact.left, chevron.compact.right, arrow.left, arrow.right, arrow.up, arrow.down, arrow.turn.up.left, arrow.turn.down.right, house, house.fill, gear, gearshape, gearshape.fill, sidebar.left, sidebar.right, line.3.horizontal, line.3.horizontal.decrease, ellipsis, ellipsis.circle, xmark, xmark.circle, xmark.circle.fill, plus, plus.circle, minus, menucard, square.grid.2x2, list.bullet, list.number

#媒体播放

play, play.fill, play.circle, play.circle.fill, pause, pause.fill, stop, stop.fill, forward, forward.fill, backward, backward.fill, goforward, gobackward, speaker, speaker.fill, speaker.wave.2, speaker.wave.2.fill, speaker.slash, music.note, music.note.list, waveform, mic, mic.fill, camera, camera.fill, video, video.fill, film, film.fill

#通信

envelope, envelope.fill, envelope.open.fill, phone, phone.fill, message, message.fill, bubble.left, bubble.left.fill, bubble.right, bubble.right.fill, paperplane, paperplane.fill, person.crop.circle, person.2.fill

#文档与内容

doc, doc.fill, doc.text, doc.text.fill, doc.on.doc, doc.plaintext, folder, folder.fill, tray, tray.fill, tray.and.arrow.up, tray.and.arrow.down, archivebox, archivebox.fill, book, book.fill, books.vertical.fill, bookmark, bookmark.fill, tag, tag.fill, paperclip, link, link.circle

#编辑与工具

pencil, pencil.circle, square.and.pencil, trash, trash.fill, square.and.arrow.up, square.and.arrow.down, scissors, paintbrush, paintbrush.fill, wrench.and.screwdriver, hammer, eyedropper, crop, slider.horizontal.3

#状态与反馈

checkmark, checkmark.circle, checkmark.circle.fill, xmark.seal, exclamationmark.triangle, exclamationmark.triangle.fill, info.circle, info.circle.fill, bell, bell.fill, bell.badge, star, star.fill, heart, heart.fill, flag, flag.fill, hand.thumbsup.fill, hand.thumbsdown.fill

#天气与自然

sun.max, sun.max.fill, moon, moon.fill, cloud, cloud.fill, cloud.sun.fill, cloud.rain, cloud.rain.fill, cloud.bolt.rain.fill, wind, snowflake, tornado, humidity, thermometer.sun, thermometer.snowflake, thermometer.medium

#系统与设备

wifi, wifi.slash, antenna.radiowaves.left.and.right, battery.100, battery.25, bolt.horizontal, lock, lock.fill, lock.open.fill, key, key.fill, person, person.fill, person.crop.circle.fill, faceid, touchid, mappin, mappin.and.ellipse, map, map.fill, location, location.fill, network, cpu, memorychip

#数学与符号

plus, plus.circle.fill, minus, minus.circle.fill, multiply, multiply.circle.fill, divide, divide.circle.fill, equal, percent, function, sum, number, numbers.rectangle, x.squareroot

#几何形状符号

circle, circle.fill, square, square.fill, triangle, triangle.fill, diamond, diamond.fill, hexagon, hexagon.fill, octagon, octagon.fill, capsule, capsule.fill, oval, oval.fill, rhombus, rhombus.fill


#ImageLabel 示例

python
import appui

state = appui.State(highlight=False)


def toggle_highlight():
    state.highlight = not state.highlight


def body():
    icon = "star.fill" if state.highlight else "star"
    return appui.NavigationStack(
        appui.VStack(
            [
                appui.HStack(
                    [
                        appui.Image(system_name=icon)
                        .foreground_color("systemYellow")
                        .image_scale("large"),
                        appui.Label("收藏", system_image=icon).foreground_color("label"),
                    ],
                    spacing=16,
                ),
                appui.Button(
                    "切换",
                    action=toggle_highlight,
                ).button_style("bordered"),
            ],
            spacing=24,
        )
        .padding(24)
        .navigation_title("SF Symbols")
    )


appui.run(body, state=state, presentation="sheet")

#使用建议

  • 层次:导航栏、列表行内小图标优先使用 Image;需要标题+图标组合时用 Label
  • 渲染模式:对多色符号可尝试链式 .symbol_rendering_mode("palette") 等(参见 修饰符 API)。
  • 可访问性:若图标单独承载语义,请为可点击区域补充 .accessibility_label("…")

#在列表行里组合 Label

python
import appui

state = appui.State(items=["下载", "设置", "关于"])


def row_key(title):
    return title


def row_view(title):
    return appui.Label(title, system_image="folder.fill")


def body():
    return appui.NavigationStack(
        appui.List([
            appui.Section("项目", [
                appui.ForEach(state.items, row_builder=row_view, key=row_key)
            ])
        ]).navigation_title("符号行")
    )


appui.run(body, state=state, presentation="sheet")

#命名提示

  • 多数 SF Symbol 同时提供 线框填充 变体(如 heartheart.fill);列表与工具栏中填充变体更易辨认。
  • 名称区分大小写,需与 Apple 官方字符串完全一致;若编译或运行期提示缺失,优先换用同目录下的替代符号。
  • Menucontent 中使用 Button(..., content=Label(...)) 可构建带图标的菜单项,与 Image 单独放置相比更利于对齐系统样式。

#与文档约定一致的分类速记(便于检索)

下列分组与示例和主文档中常用命名一致,可与上文「按类别速览」交叉对照。若符号在某 iOS 版本不可用,请以系统 SF Symbols 目录为准替换为同义图标。

#导航(常用)

chevron.left, chevron.right, arrow.left, arrow.right, house.fill, gear, sidebar.left, line.3.horizontal

#媒体(常用)

play.fill, pause.fill, stop.fill, forward.fill, backward.fill, speaker.wave.2.fill, mic.fill, camera.fill, photo.fill

#通信(常用)

envelope.fill, phone.fill, message.fill, bubble.left.fill, paperplane.fill

#内容(常用)

doc.fill, doc.text.fill, folder.fill, tray.fill, archivebox.fill, book.fill, bookmark.fill

#编辑(常用)

pencil, trash.fill, doc.on.doc, square.and.arrow.up, square.and.arrow.down, scissors, paintbrush.fill

#状态(常用)

checkmark, xmark, exclamationmark.triangle.fill, info.circle.fill, bell.fill, star.fill, heart.fill, flag.fill

#天气(常用)

sun.max.fill, moon.fill, cloud.fill, cloud.rain.fill, wind, snowflake, thermometer

#系统(常用)

wifi, antenna.radiowaves.left.and.right, battery.100, lock.fill, key.fill, person.fill, mappin

#数学(常用)

plus, minus, multiply, divide, equal, number

#形状符号(常用)

circle.fill, square.fill, triangle.fill, diamond.fill, hexagon.fill

#版本与渲染说明

  • Apple 会持续在 SF Symbols 大版本中加入新名称;同一字符串在旧系统上可能静默降级或无法显示,上线前请在目标最低 iOS 版本上实机扫一遍图标网格。
  • Image(system_name=...) 默认走模板渲染;需要保留多色符号时,使用链式 .symbol_rendering_mode("multicolor")
  • ToolbarItemList 行内,Label 通常比裸 Image + Text 更省代码,且与系统间距对齐更一致。
python
import appui

state = appui.State(picked="")


def pick_copy():
    state.picked = "copy"


def pick_trash():
    state.picked = "trash"


def body():
    return appui.NavigationStack(
        appui.VStack(
            [
                appui.Menu(
                    title="更多",
                    content=[
                        appui.Button(
                            action=pick_copy,
                            content=appui.Label("复制", system_image="doc.on.doc"),
                        ),
                        appui.Button(
                            action=pick_trash,
                            role="destructive",
                            content=appui.Label("删除", system_image="trash.fill"),
                        ),
                    ],
                ),
                appui.Text(f"上次操作: {state.picked or '无'}").padding(top=12),
            ],
            spacing=16,
        )
        .padding(24)
        .navigation_title("菜单与符号")
    )


appui.run(body, state=state, presentation="sheet")

注意:MenucontentButton 列表;带图标的条目使用 Button(..., content=Label(...))

#检索建议

在 macOS 上打开 SF Symbols 应用,复制名称到 system_image=;不要凭记忆手写符号名。对同一语义准备 主符号 + 备用符号(例如 doc.text.fill 不可用时退回 doc.fill),可减少用户设备差异带来的空白图标。