Good morning, I have problems trying to position the recycler in the center, I found a way to make the recycler horizontal with the following line
rvLista = findViewById(R.id.rvListaReportes);
rvLista.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
but I can't find a way to make the scroll in the center not at the top investigating it is supposed to be enough with this line
SnapHelper helper = new LinearSnapHelper();
helper.attachToRecyclerView(rvLista);
But I don't get the result in which I need it to position itself in the red box, that is, in the center
Where the position of your
RecyclerView
is defined is the layout, for example you can use aRelativeLayout
and define the attributeandroid:layout_centerInParent="true"
, this will cause your toRecyclerView
always display in the vertical center.