การใช้ SF Symbols
แสดงไอคอนระบบที่ปรับขนาดได้ด้วย systemName
การใช้ SF Symbols เป็นบทเรียน SwiftUI Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน SwiftUI Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส SwiftUI Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Apple Icons for Free
SF Symbols is Apple library of thousands of crisp, scalable icons that match the system font. They are free and built right in. ⭐
Showing a Symbol
Display one with Image and the systemName parameter. The name comes from the SF Symbols app, like star or heart.
Image(systemName: "star")Filled Variants
Many symbols offer a filled version. Just add .fill to the name to get a solid icon instead of an outline.
Image(systemName: "star.fill")Symbols Are Text-Like
Because SF Symbols align to the font, you size them with font and the same text styles you already know.
Image(systemName: "bell")
.font(.title)Coloring Symbols
Tint a symbol with foregroundStyle, exactly like text. This makes stars yellow or hearts red in one line.
Image(systemName: "heart.fill")
.foregroundStyle(.red)Scaling with imageScale
The imageScale modifier nudges a symbol to small, medium, or large relative to its surrounding text.
Image(systemName: "gear")
.imageScale(.large)Symbols Inside Text
You can drop a symbol inside a Text view, so an icon and a word flow together as one styled label.
Text("\(Image(systemName: "bolt")) Fast")Labels Pair Icon and Title
The Label view bundles a symbol with text, giving you a tidy icon-plus-title combo used all over iOS.
Label("Favorites", systemImage: "star")Multicolor and Hierarchical
Use symbolRenderingMode for richer looks. Hierarchical adds depth, while multicolor uses the symbol built-in colors.
Image(systemName: "cloud.sun.fill")
.symbolRenderingMode(.multicolor)Symbols in Buttons
Symbols shine inside buttons and toolbars, giving clear, compact actions like share, add, or delete.
Button(action: share) {
Image(systemName: "square.and.arrow.up")
}Find the Right Name
Download the free SF Symbols app from Apple to browse and copy exact names. Guessing names often fails silently.
Quick Check
How do you display an SF Symbol in SwiftUI?
Lesson Recap
You added SF Symbols with systemName, styled them like text, and paired them with titles using Label. Crisp icons everywhere. 🚀
เรียนรู้ Swift ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 30
- บทเรียน
- 120
คำถามที่พบบ่อย
บทเรียน “การใช้ SF Symbols” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การใช้ SF Symbols” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส SwiftUI Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส SwiftUI Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การใช้ SF Symbols”
แสดงไอคอนระบบที่ปรับขนาดได้ด้วย systemName คุณปฏิบัติ SwiftUI Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน SwiftUI Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน SwiftUI Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “การใช้ SF Symbols” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน SwiftUI Academy นี้ได้ไหม
ได้ บทเรียน SwiftUI Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ