This is the Java code for creating an alpha animator object.
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(myView, "alpha", 0.5f, 0f);
This is the Kotlin code for doing the same.
val objectAnimator = ObjectAnimator.ofFloat(myView, "alpha", 0.5f, 0f)
After I converted above Java code to Kotlin, Android Studio is giving me a red error warning with the this message when hover over the line where the error occurs. Could not find property setter method setAlpha on java.lang.Void more
Despite the IDE is giving this error, but I am still able to compile and run it. Any idea why it's giving this error in Kotlin and how to get rid of this error warning?
View.ALPHA
instead ofalpha
as a method parameter. Maybe it helps. – Lucindalucine