setPadding이 내 코드에서 작동하지 않습니다. 모든 카드가 함께 연결되어있는 것으로 보입니다. 패딩이 적용되지 않았 음을 나타냅니다.동적으로 CardView를 만들 때 setPadding()이 작동하지 않습니다.
card = new CardView(mContext);
// Set the CardView layoutParams
LayoutParams params = new LayoutParams(
LayoutParams.MATCH_PARENT,
LayoutParams.WRAP_CONTENT
);
card.setLayoutParams(params);
//Set CardView Padding
card.setPadding(15,15,15,15);
// Set CardView corner radius
card.setRadius(8);
// Set cardView content padding
card.setContentPadding(15, 15, 15, 15);
.... 나는 카드와의 사이에 두 개의 서로 다른 카드가없는 사이에 패딩이 필요합니다 내용 – ShrG
여백이 필요합니다. ** params.setMargins (10, 10, 10,10); ** –
내 편집 ans를 확인하십시오. –