【发布时间】:2016-02-27 18:41:37
【问题描述】:
我需要有关 onscroll 方法的帮助...所以我尝试了一些我在 stackoverflow 上找到的东西,但其中大多数都适用于线性布局等。如果您能指出我正确的方向会非常有帮助...
我正在使用 instagram api 加载图片。它一次发送 20 张图片,所以当我到达页面底部时需要加载更多图片
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);
mRecyclerView.setLayoutManager(new GridLayoutManager(this, 2));
//configViews();
// mLayoutManager = new GridLayoutManager(this, 2);
// mRecyclerView.setLayoutManager(mLayoutManager);
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
});
....
}
【问题讨论】:
标签: android gridview android-recyclerview