Reputation: 13
Custom color in asset folder so I could use with things like foregroundColor background and other.
I give this color name
"CL1"
Example foregroundColor(Color("CL1")) background(Color("CL1"))
My problem right now I can't use this as background because i tried and its not working. Also no error alert.
Color("Cl1").ignoresSafeArea() //background
When apply with text it work.
Text("test").foregroundColor(Color("CL1"))
Upvotes: 1
Views: 212
Reputation: 257493
Try with ZStack
ZStack {
Color("CL1").ignoresSafeArea()
Text("test")
}
Upvotes: 1