使用 ViewPager + GridView 导致页面卡顿

原因一:滑动的时候需要预加载另外两份数据导致UI卡顿;

原因二:在onPageSelected里面做耗时操作,经测试可知onPageSelected是执行刷新UI之前的,所以造成滑动会卡的现象;

解决方法:在onPageSelected里面使用new Handler().post或者AsynTask进行延迟初始化;

猜你喜欢

转载自blog.csdn.net/qq1073273116/article/details/52222627