How to set visibility in Kotlin?
if you want to visible icon
ic_back.visibility = View.VISIBLE
and if you want to visibility GONE so please try it :
ic_back.visibility = View.GONE
In response to this answer, I believe a Kotlin-styled way to accomplish this can also be written as:
fun showHide(view:View) {
view.visibility = if (view.visibility == View.VISIBLE){
View.INVISIBLE
} else{
View.VISIBLE
}
}