出現的問題
- RecyclerView顯示不全
- 滑動衝突
解決方式
-
ScrollView替換爲android.support.v4.widget.NestedScrollView
-
自定義LinearLayoutManager private class MyLinearLayoutManager extends LinearLayoutManager {
public MyLinearLayoutManager(Context context) { super(context); } @Override public boolean canScrollVertically() { return false; } }
3.` //解決數據加載不完的問題
recyclerView.setNestedScrollingEnabled(false);
recyclerView.setHasFixedSize(true);
//解決數據加載完成後, 沒有停留在頂部的問題
recyclerView.setFocusable(false);`
`