![](/img/trans.png)
[英]How to set the UIButton tint color of a system image when pressed?
[英]How to set the tint inside of a UIButton using a system icon image?
不幸的是,沒有內置的方法可以做到這一點,因為person.circle.fill
符號不支持多色:
您可以創建一個自定義符號並在那里添加顏色,但這需要做很多工作......您需要修改每個變體。
相反,我會
Command
+ C
在 SF Symbols 應用程序中復制符號用法:
struct ContentView: View {
var body: some View {
Image("person.circle.fill")
.resizable()
.frame(width: 50, height: 50)
}
}
結果:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.