RecyclerView滚动缓慢

时间:2019-10-31 10:12:27

标签: android json android-recyclerview nestedrecyclerview

当我从Json获取数据并放入recyclerview中时。滚动非常慢吗?请帮我解决这个问题。

SELECT * FROM user_constraints WHERE table_name = 'TEST_DATA';
SELECT * FROM user_indexes WHERE table_name = 'TEST_DATA';

2 个答案:

答案 0 :(得分:0)

使用此

            getJsonData();
            recyclerView = findViewById(R.id.recycleview);
            adapter1 = new Landing_recycler_adapter(MainActivity.this, movieList);

            recyclerView.setLayoutManager(new LinearLayoutManager(this));
            recyclerView.setAdapter(adapter1);

            getJsonData();
            recyclerView = findViewById(R.id.recycleview);
            adapter1 = new Landing_recycler_adapter(MainActivity.this, movieList);

            recyclerView.setLayoutManager(new GridLayoutManager(this,2));
            recyclerView.setAdapter(adapter1);

答案 1 :(得分:0)

并禁用RecyclerView的嵌套滚动

recyclerView.setNestedScrollingEnabled(false);