简体   繁体   English

布局视图内的Recycler视图水平

[英]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. 我是一个Android开发人员,需要执行以下操作: 像Facebook那样在Recyclerview上水平 输入图像说明在那是一个带有tablayout的水平recyclerview,我想做的是,当用户滚动de recycler视图时,他无法滑动标签布局。 Like facebook tab videos 像facebook标签视频

Create a recyclerView in the xml and add this code in the activity. 在xml中创建一个recyclerView并将此代码添加到活动中。 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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM