SwiftUI: How to set background color by color name string

前端 未结 0 1595
清酒与你
清酒与你 2021-01-04 00:44

I have var color: String = "blue". With that variable I want to set the background color of a Button. I tried .background(Color(color)),

相关标签:
回答
  • 消灭零回复
提交回复
热议问题