Skip to content
Advertisement

Tag: android-cardview

Cardview not displaying

I am trying to use com.google.android.material.card.MaterialCardView to display images and text. In the xml file it appears to be correct but when running the application, the card view is blank not even a text. Below are my xml file and grade file. The actual output I want also is shown in the picture (expected output) and the actual result is

Why is the content of CardView inside a RecyclerView (in my case) changing when I scroll?

I have the same question like this post “Cardview’s data are changed while scrolling RecyclerView”. But taking out the statics isn’t working. Context of what I am doing: I am adding a couple of buttons inside a FlexboxLayout and again inside a CardView (CardView inside a RecyclerView). Buttons are being added dynamically. The same thing happens with a couple of

How can i remove unnecessary top padding in cardview?

I managed to implement Cardviews in my app, but the cardview show an unnecessary padding in the top. What i want to achieve is to get a header image like this : Here’s my cardview Layout file : This is the code of the RecyclerView : android:layout_height=”match_parent” android:padding=”16dp”> I manage to change the attribute cardUseCompatPadding but that not affect the

Advertisement