UIImage 使用 SF Symbols

设置 SF Symbols 样式

参考:

1
2
3
let config = UIImage.SymbolConfiguration(pointSize: 14, weight: .bold, scale: .large) 
// let config = UIImage.SymbolConfiguration(font: .monospacedSystemFont(ofSize: 14, weight: .regular))
let image = UIImage(systemName: "doc.circle.fill", withConfiguration: config)

设置 SF Symbols 颜色

参考:

1
let image = UIImage(systemName: "doc.circle.fill", withConfiguration: config)?.withTintColor(.red, renderingMode: .alwaysOriginal)

UIImage 使用 SF Symbols
https://wonderhoi.com/2024/11/06/UIImage-使用-SF-Symbols/
作者
wonderhoi
发布于
2024年11月6日
许可协议