SwiftUI筆記:利用.fill填充漸層顏色到Rectangle()
利用.fill填充漸層顏色到Rectangle()

版本:Xcode11 Beta6
struct ContentView: View {
var body: some View {
Rectangle()
.fill(LinearGradient(gradient:
Gradient(colors: [Color.red,Color.yellow]),
startPoint: .top,
endPoint: .bottom
))
}
}

版本:Xcode11 Beta6
留言
張貼留言