foregroundStyle
modifier to apply gradients to views such as Text, Images, and Shapes.
RoundedRectangle(cornerRadius: 20)
.foregroundStyle(.conicGradient(colors: [.green, .blue],
.foregroundStyle(.conicGradient(colors: [.green, .blue],
center: .center))
In this image, you can see foregroundStyle being used to apply the new conicGradient.
The conic gradient is a lot like angularGradient.
Note: These examples come from a book called SwiftUI Views Mastery which is a picture book reference of SwiftUI views and code that’s almost 1,000 pages.
Interested in beginning SwiftUI?
Start with the free SwiftUI Views Quick Start picture book!
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.