Search code examples
androidkotlinlistviewcardview

Is there a way to stack a CardView within a RecyclerView from the bottom instead of from the top?


I'm a newbie when it comes to Android coding, so please bear with me. I looked this up for quite some time before posting here, so that I don't waste your time with a question that I could have answered myself through some research.

Here's my issue: I have a CardView and I want the items to start popping up from the bottom instead of from the top. For example, something like this.

I found out that you can do this via the "stackFromBottom" XML attribute in ListViews and GridViews, but it doesn't work for CardViews. I also noticed that you can change a ListView's gravity, but CardView doesn't seem to support that either.

So is there a simple way to populate the CardView in this way?

Any help would be greatly appreciated.


Solution

  • Since you said that you are using a recycler view you could use a simple property to accomplish what you need.