Hello I want to set programmatically Layout_weight for imageview with kotlin code for be sure layout_weight not weightsum LIKE THE CODE BELOW
fun stack(x:Int){
LinearLayout1.weightSum= 1F
imageView1.visibility=View.VISIBLE
imageView2.visibility=View.INVISIBLE
imageView3.visibility=View.INVISIBLE
if (x==1) {
imageView1.visibility=View.VISIBLE
imageView1.layout_weight=1F ***//I want this***
imageView2.visibility=View.INVISIBLE
imageView3.visibility=View.INVISIBLE
}
else if (x==2){
imageView1.visibility=View.INVISIBLE
imageView2.visibility=View.VISIBLE
imageView2.layout_weight=1F ***//I want this***
imageView3.visibility=View.INVISIBLE
}
else if (x==3){
imageView1.visibility=View.INVISIBLE
imageView2.visibility=View.INVISIBLE
imageView3.visibility=View.VISIBLE
imageView3.layout_weight=1F ***//I want this***
}
}