Make ImageView fit width of CardView

前端 未结 10 686
太阳男子
太阳男子 2020-12-04 11:00

I have a CardView with rounded corners, I want to have an ImageView at the top like shown in the example taken from the material design guidelines

10条回答
  •  执念已碎
    2020-12-04 11:39

    EDIT 2015/09/29

    https://github.com/vinc3m1/RoundedImageView added support of rounding of selected corners

    You can also use makeramen RoundedImageView https://github.com/vinc3m1/RoundedImageView, and to remove auto padding in CardView for pre LolliPop use

    yourCardView.setPreventCornerOverlap(false);

    And then set padding you needded to show shadows of cardview

提交回复
热议问题