Set CardView height programmatically

前端 未结 3 1420
不思量自难忘°
不思量自难忘° 2021-02-19 20:48

I am new to Android dev and I\'m having trouble trying to set the min height of a it.gmariotti.cardslib.library.view.CardView programmatically. I create a new insta

3条回答
  •  梦如初夏
    2021-02-19 21:26

    myCardView.setLayoutParams(new RelativeLayout.LayoutParams(20, 20));
    

    it depends that your cardview is a child of which layout, in this case it is under Relative Layout

提交回复
热议问题