Skip to content
Advertisement

RecyclerView Items cover entire screen

I’m trying to make a simple chat room in android studio, but for some reason each chat message covers the entire screen.

I’m trying to follow the example here on github https://github.com/android/views-widgets-samples/tree/main/RecyclerView/

I’m sure it’s just something super simple, but I don’t know what the search terms are to find it, and my search so far has been fruitless.

This is my chat room activity:

JavaScript

And this is my text row item:

JavaScript

I don’t know if you guys actually need the source code, but here it is regardless.

JavaScript
JavaScript
JavaScript
JavaScript

There are a couple of other views that work in tandem with this one for logging into the system, but I’m pretty sure this should be easy enough to get working.

Advertisement

Answer

In your text row item in the ConstraintLayout just change the this

android:layout_height="match_parent"

by

android:layout_height="wrap_content"

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement