Answers for "recyclerView heights decrease on scroll"

0

recyclerView heights decrease on scroll

LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
layoutManager.setMeasurementCacheEnabled(false);

YourRecyclerView.setLayoutManager(layoutManager);
YourRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
        @Override
        public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
            super.onScrolled(recyclerView, dx, dy);
            layoutManager.requestLayout();
        }
    });
Posted by: Guest on May-10-2021

Code answers related to "recyclerView heights decrease on scroll"

Browse Popular Code Answers by Language