Materialrefreshlibrary使用中的一个bug
2017-02-14 00:00
197 查看
摘要: 比SwipeRefreshLayout更漂亮和强大的下拉刷新控件:Android-MaterialRefreshLayout
Materialrefreshlibrary 地址 https://github.com/android-cjj/Android-MaterialRefreshLayout
这个是git上别人写的。下载下来后,运行没什么问题。不过用到我的项目上有个bug。fragment切换时加载的圆圈会出现,而且是叠加在一起,就是切换几次就叠加几个圆圈。后面查看源码才发现。只要在头尾headerview里面的onAttachedToWindow方法设置下就可以了。以此记录。代码如下:
Materialrefreshlibrary 地址 https://github.com/android-cjj/Android-MaterialRefreshLayout
这个是git上别人写的。下载下来后,运行没什么问题。不过用到我的项目上有个bug。fragment切换时加载的圆圈会出现,而且是叠加在一起,就是切换几次就叠加几个圆圈。后面查看源码才发现。只要在头尾headerview里面的onAttachedToWindow方法设置下就可以了。以此记录。代码如下:
@Override protected void onAttachedToWindow() { super.onAttachedToWindow(); final float density = getContext().getResources().getDisplayMetrics().density; materialWaveView = new MaterialWaveView(getContext()); materialWaveView.setColor(waveColor); addView(materialWaveView); circleProgressBar = new CircleProgressBar(getContext()); LayoutParams layoutParams = new LayoutParams((int) density * progressSize, (int) density * progressSize); layoutParams.gravity = Gravity.CENTER; circleProgressBar.setLayoutParams(layoutParams); circleProgressBar.setColorSchemeColors(progress_colors); circleProgressBar.setProgressStokeWidth(progressStokeWidth); circleProgressBar.setShowArrow(isShowArrow); circleProgressBar.setShowProgressText(textType == 0); circleProgressBar.setTextColor(progressTextColor); circleProgressBar.setProgress(progressValue); circleProgressBar.setMax(progressValueMax); circleProgressBar.setCircleBackgroundEnabled(isShowProgressBg); circleProgressBar.setProgressBackGroundColor(progressBg); addView(circleProgressBar); //添加了这一句。bug解决 circleProgressBar.setVisibility(GONE); }
相关文章推荐
- 疑是Microsoft Enterprise Library June 2005的一个小bug
- 在使用.Net Reflector时发现了一个Bug:)
- android上使用cocos2dx的一个bug
- 最近在使用MyEclipse的SVN插件时总是弹出一个大大的对话框,报一个Failed to load JavaHL Library.错误 [java] view plaincopy Failed
- 通达OA--关于工作流强制使用电子签章中的一个BUG
- 写给公司的一个Bug需求管理系统,公司一直使用良好
- WCF使用Json传输的一个BUG
- Android使用EditText遇到的一个bug
- 使用Qstring时候碰到的一个bug
- 最近在使用MyEclipse的SVN插件时总是弹出一个大大的对话框,报一个Failed to load JavaHL Library.错误
- 在使用.Net Reflector时发现了一个Bug:)
- Linux 2.4.18的内核在使用S3C2410板的USB设备时碰到的一个Bug的解决办法
- 从AX4.0本地化SP2凭证系统的一个bug看UserConnection的使用
- 使用GridView出现的一个bug
- Flex AIR: 使用透明 NativeWindow 窗体呈现 Line Chart 的一个 bug (Exception in CartesianChart/updateMultipleAxesStyles)
- 疑是Microsoft Enterprise Library June 2005的一个小bug (续)
- posix多线程程序使用条件变量的一个常见bug
- 解决Ie8中使用Ie7pro时鼠标手势的一个bug
- posix多线程程序使用条件变量的一个常见bug
- Android SDK的一个bug------parameters.getFocusDistances无法使用(被拍摄物体和摄像头之间的距离无法测量)