Reputation: 1587
Check this android studio error
I tried same in java
, it worked and also working fine for LinerLayout
. Does anyone know what is the issue ?
Upvotes: 1
Views: 1007
Reputation: 1587
based on Nilesh Rathod answer, it worked, Thanks
val params = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT)
Upvotes: 0
Reputation: 71
you can use RelativeLayout.LayoutParams
cardView.setLayoutParams(RelativeLayout.LayoutParams(20, 20));
Upvotes: 1