在SwiftUI
中,您可以使用foregroundColor
修饰符更改图标的颜色:
Change the stroke/fill color of SF Symbol icon in SwiftUI?
有没有办法改变颜色UIKit
?我查阅了文档并没有找到任何相关的内容。
let configuration = UIImage.SymbolConfiguration(pointSize: 16, weight: .regular, scale: .medium)
let iconImage = UIImage(systemName: "chevron.right", withConfiguration: configuration)