Luccas Ferreira
Luccas Ferreira

Reputation: 11

Recycler view horizontal inside a tablayout

im a android developer and need to do this: Recycler view horizontal like facebook enter image description here Thats one recyclerview horizontal with a tablayout, i wanna do is while the user be scrolling de recycler view his cannot swipe the tab layout. Like facebook tab videos

Upvotes: 1

Views: 1066

Answers (1)

Prashanth Verma
Prashanth Verma

Reputation: 588

Create a recyclerView in the xml and add this code in the activity. You will achieve the horizontal scrolling without swiping the tab layout.

adapter = new Adapter(// pass your arguments);
layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
recycleView.setLayoutManager(layoutManager);
recycleView.setAdapter(adapter);
recycleView.setNestedScrollingEnabled(false);

Upvotes: 1

Related Questions