Open shenghai2019 opened 5 years ago
将 PagerGridLayoutManager 中的 预存储View 这段代码注释掉就可以了 // if (mOffsetX == 0 && mOffsetY == 0) { // // 预存储View // for (int i = 0; i < mOnePageSize; i++) { // if (i >= getItemCount()) break; // 防止数据过少时导致数组越界异常 // View view = recycler.getViewForPosition(i); // addView(view); // measureChildWithMargins(view, mWidthUsed, mHeightUsed); // } // }
将 PagerGridLayoutManager 中的 预存储View 这段代码注释掉就可以了 // if (mOffsetX == 0 && mOffsetY == 0) { // // 预存储View // for (int i = 0; i < mOnePageSize; i++) { // if (i >= getItemCount()) break; // 防止数据过少时导致数组越界异常 // View view = recycler.getViewForPosition(i); // addView(view); // measureChildWithMargins(view, mWidthUsed, mHeightUsed); // } // }