Android 循环视图滚动速度慢
当我从Json获取数据并放入recyclerview时。它滚动得很慢?请帮我解决这个问题Android 循环视图滚动速度慢,android,json,android-recyclerview,nestedrecyclerview,Android,Json,Android Recyclerview,Nestedrecyclerview,当我从Json获取数据并放入recyclerview时。它滚动得很慢?请帮我解决这个问题 recyclerView = findViewById(R.id.recycleview); adapter1 = new Landing_recycler_adapter(MainActivity.this, movieList); GridLayoutManager gridLayoutManager = new GridLayoutManager(get
recyclerView = findViewById(R.id.recycleview);
adapter1 = new Landing_recycler_adapter(MainActivity.this, movieList);
GridLayoutManager gridLayoutManager = new GridLayoutManager(getApplicationContext(),2);
gridLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); // set Horizontal Orientation
recyclerView.setLayoutManager(gridLayoutManager); // set LayoutManager to RecyclerView
// recyclerView.setLayoutManager(new GridLayoutManager(this, GridLayoutManager.HORIZONTAL, true));
recyclerView.setHasFixedSize(true);
recyclerView.setAdapter(adapter1);
getJsonData();
用这个
getJsonData();
recyclerView = findViewById(R.id.recycleview);
adapter1 = new Landing_recycler_adapter(MainActivity.this, movieList);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(adapter1);
或
并禁用RecyclerView的嵌套滚动
recyclerView.setNestedScrollingEnabled(false);
你为什么要设置两次layoutmanager?@sanjeev一行在评论下LOL:)很高兴你编辑了这篇文章。您是否在recyclerview外使用滚动视图?2。您将获得
getJsonData()代码>设置适配器后?3.电影列表包含哪些内容?请提供更多的代码。我没有得到确切的答案。请提供更多的代码,这个问题可能与其他行动有关。没有日志错误。只是慢慢地走。表示性能非常差。如果您在recyclerView的项目视图中将图像设置为imageView,则只需使用Glide或毕加索进行设置。无Logcate错误。只是慢慢地走。意味着性能非常差。
recyclerView.setNestedScrollingEnabled(false);