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

Daniele B

03/30/2024, 12:26 PM
I guess it's a simple question, but Gemini is not able to give me an answer. How to change the background color of a Column on mouse over?
1
Ok, I guess this is the way:
Copy code
val intSrc = remember { MutableInteractionSource() }
val isHovered by intSrc.collectIsHoveredAsState()
Column(
	modifier = Modifier
	.hoverable(intSrc)
	.background(if (isHovered) Color1 else Color2)
)
👌 1
m

Max

04/01/2024, 4:33 PM
Github copilot kind of knows that stuff very well. Gemini does not really help me often times. Just my 2 cents
4 Views