Hi the Given below is my Code, where my button should become INVISIBLE but the INVISIBLE is not working
fun onPlay(view: View){
var play = findViewById(R.id.play) as Button
play.isClickable=false
play.visibility=view.INVISIBLE
}
You have a mistake in your code, visibility constant should be set from Class variable, not from argument variable. Change view.INVISIBLE by View.INVISIBLE
fun onPlay(view: View){
var play = findViewById(R.id.play) as Button
play.isClickable=false
play.visibility= View.INVISIBLE // v letter should be capital
}
use play.visibility=View.VISIBLE
to visible and play.visibility=View.GONE
to invisible or to hide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With