0

I use LinearLayoutManager to show RecyclerView list horizontally

XML

    <android.support.v7.widget.RecyclerView
        android:id="@+id/dailyOffersList"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

Code

dailyOffersList.adapter = DailyOffersListAdapter(dailyOffer)
dailyOffersList.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)

It is XML of item and it has width as wrap_content https://codeshare.io/5XnldM

But there empty space int the end of list, and it happens only if it horizontally, like this

enter image description here

in the end

enter image description here

Tigran Babajanyan
  • 1,967
  • 1
  • 22
  • 41

1 Answers1

0

Change the match_parent in the xml to wrap_content.

match_parent is supposed to fill the whole with of the screen.