https://kotlinlang.org logo
#compose
Title
# compose
k

kevin_abrioux

11/27/2020, 2:17 PM
Hey guys 👋 any idea how to make a gradient background to a Surface object ?
t

Timo Drick

11/27/2020, 3:21 PM
Not sure if this is the simplest solution but it work:
Copy code
Modifier.drawBehind {
            drawRect(LinearGradient(listOf(Color.Red, Color.LightGray), 0f, 0f, size.width, size.height))
        }
👍 3
k

kevin_abrioux

11/27/2020, 5:10 PM
Perfect, thx man
17 Views