saiwu-bigkoo / android-convenientbanner Goto Github PK
View Code? Open in Web Editor NEWSimple and convenient banner, loop viewpager with 3D effects
Simple and convenient banner, loop viewpager with 3D effects
请问下刷新数据重复调用setPager会出现Observer android.support.v4.view.ViewPager$PagerObserver was not registered怎么解决
readme 里有一个符号错了
demo是用Module方式依赖,你也可以使用gradle 依赖:
compile 'com.bigkoo:convenientbanner:1.1.1’
上面最后一个符号错了 应该是'
ConvenientBanner.setScrollDuration(10000);
ConvenientBanner.startTurning(10000);
我自定义了淡入淡出的切换效果,再做了模糊处理,有时候图片就会乱跳,还会有空白页。
如题
切换效果还有种类似呼吸灯的效果,可能要用到动画
item没滚动一次就要创建个ImageView对象是不是不太好,最好集成https://github.com/JakeWharton/salvage 这个项目,让view可以有缓存就更好了
如題, 謝謝.
原因是应为CBPageAdapter里面的geteview 也设置了tag .......获取到了我在UpdateUI 里面设置的.然而类型不对就挂掉了......我的处理方式是imageView.setTag(R.id.tag_1,uri); 这样解决的
PageIndicator能不能改位置,比如右下角。
Android-ConvenientBanner在使用Glide作为图片加载器时会报错,内容如下:
java.lang.IllegalArgumentException: You must not call setTag() on a view Glide is targeting
应该是CBPageAdapter类中getView的实现导致的
@Override public View getView(int position, View view, ViewGroup container) {
Holder holder;
if (view == null) {
holder = (Holder) holderCreator.createHolder();
view = holder.createView(container.getContext());
view.setTag(holder);
} else {
holder = (Holder<T>) view.getTag();
}
if(mDatas!=null&&!mDatas.isEmpty())
holder.UpdateUI(container.getContext(), position, mDatas.get(position));
return view;
}
将该方法改为如下就可以正常运行:
@Override
public View getView(int position, View view, ViewGroup container) {
Holder<T> holder = (Holder) holderCreator.createHolder();
view = holder.createView(container.getContext());
if (mDatas != null && !mDatas.isEmpty())
holder.UpdateUI(container.getContext(), position, mDatas.get(position));
return view;
}
但这样应该就不能重用ImageView了吧!
我对Android不是很熟悉,不知道我提的问题是不是存在,或者是我用法不正确?如果问题存在,请问作者有什么好的解决方法么?
可不可以把,下面的几个点仿的位置调整到右下侧
ConvenientBanner类中的setPageTransformer()方法报IllegalAccessException,好像是反射那问题
关于ViewPage使用硬件layers的一些问题
http://blog.udinic.com/2013/09/16/viewpager-and-hardware-acceleration
ConvenientBanner没有ViewPage暴露出来,并且也没有提供OnPageChangeListener方法。希望能够改进这一块,因为快速滑动的时候确实会卡顿
要做引导页效果,希望到最后一页的时候停在那边不要再循环了。
在gradle中加上 compile 'com.bigkoo:convenientbanner:1.0.0' 一直没有办法正常引用,只能下载aar粘贴到工程中。
另外你的android:icon会与调用者的android:icon冲突,应该把library moule中的android:icon删掉。
1、首先很致命的问题,用起来居然卡卡的
手指滑动过后,感觉有些滞后
2、我用在ViewPager里面嵌套,点击每个Item居然无效;
3、canLoop不能再代码里面设置。如果我实现不清楚是否需要canLoop,那么我肯定是要在后面设置的,xml文件可以,代码居然不可以
版本2.0
这句话运行时会报错,求解
使用时android studio
只有一张图片,轮播可以stop,但是手势滑动可以看到多张一样的图。
如果数据设置两条以上,
例如3条或者4条,上来就直接向左边滑动,控件会被清一下,
您的这个adapter处理我不太看得懂,
下面留一个gif,
网络请求超时后报错
com.android.volley.TimeoutError
E/AndroidRuntime: FATAL EXCEPTION: main Process: com.fangbei.market, PID: 28280
java.lang.NullPointerException ,
at com.bigkoo.convenientbanner.ConvenientBanner$1.run(ConvenientBanner.java:88)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
在xml按例子中的进行了设置,在运行时报错了,跑不起来,
我就是想问,可否在代码中设置,设置方法是什么,
最后一个轮播到达第一个时会有。
convenientBanner.setPages(new CBViewHolderCreator() {
@OverRide
public ImageHolder createHolder() {
return new ImageHolder();
}
},networkImages);
networkImages 只能是List
不能用
ArrayList<HashMap<String,Object>> 這類 ?
"image" : url
"text" : "hello this is image 1"
然後在相片上顯示字串
如题 还有 手动滑动 手指离开后滑动的速度太慢了
可不可以将下方的小黑点的导航改为数字比如(4/5)这样的效果
就是一开始是可以轮播图片的,但是旋转屏幕后就变成一片空白了,再转回来也是空白的,请问怎么解决?谢谢。
与compile 'in.srain.cube:ultra-ptr:1.0.11' 该开源插件,把Banner组合到ListView的HeaderView上,出现打侧方向下拉,就会卡住一下,然后无法正常左右手动滑动
如果datas数组只有一条数据,现在依然能够左右无限滚动。从需求上讲这时我可能不希望viewpager能够滚动,因为滚来滚去都只有一条数据。我现在是通过重写dispatchTouchEvent来禁止触摸事件,但总归是hack。能否增加一个开关来让控制滚动?
listView设置为头部视图时,设置banner的高度为wrap_content 无效,必须要设置固定高度或match_parent, 另外,源码里好像没有重新测算高度
holder.convenientBanner.setPageIndicator(new int[]{R.drawable.kw_homesys_dotnormal, R.drawable.kw_homesys_dotselected});
holder.convenientBanner.setPageIndicatorAlign(ConvenientBanner.PageIndicatorAlign.ALIGN_PARENT_RIGHT);
holder.convenientBanner.setPages(new CBViewHolderCreator() {
@OverRide
public NetworkImageHolderView createHolder() {
return new NetworkImageHolderView();
}
}, images);
java.lang.IllegalStateException: The application's PagerAdapter changed the adapter's contents without calling PagerAdapter#notifyDataSetChanged! Expected adapter item count: 2, found: 4 Pager id: com.rjfittime.app:id/cbLoopViewPager Pager class: class com.bigkoo.convenientbanner.CBLoopViewPager Problematic adapter: class com.bigkoo.convenientbanner.CBLoopPagerAdapterWrapper
at android.support.v4.view.ViewPager.populate(ViewPager.java:1000)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:552)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:514)
at android.support.v4.view.ViewPager.setCurrentItem(ViewPager.java:506)
at com.bigkoo.convenientbanner.CBLoopViewPager.setCurrentItem(CBLoopViewPager.java:132)
at com.bigkoo.convenientbanner.CBLoopViewPager.setCurrentItem(CBLoopViewPager.java:138)
at com.bigkoo.convenientbanner.ConvenientBanner$1.run(ConvenientBanner.java:75)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
作为listview 的header 之后,给listview 添加下拉刷新,当触摸banner下拉刷新,刷新完成后,banner不能自己滚动。希望修复,谢谢!
在最後1頁不能向右掃回第1頁 及 第1頁不能向左掃到最後頁
還有另1問題就是在activity第一次增加圖片在ConvenientBanner上,然後向左掃就加載失敗.再次掃左或右才回復正常
我的手机是nexus5,6.0系统,连续快速滑动时,ui会卡顿大约5秒的时间,卡的不能进行任何操作,也没报错,5秒后正常,查阅了下源码也没找出是什么原因
我这边有个项目,其中的广告图是根据商场不同需要切换不同的广告图。
List中存放的是DrawableId,然后clean了List数据后,重新向List内add了新的DrawableId。然后调用调用notifyDataSetChange,控件不刷新生效,只能重新setPage才能生效
请问一下是我哪个地方做错了嘛?
建议检查一下数组为空的时候的越界情况。
于是会出现 轮播速度变快的情况,能否加一个判断当前是否已经正在轮播的方法 turning这个属性是private
能否改成public或者提供get方法
当设置startTurning(1000)的时候,我使用了三张图片,第一圈滚动是正常的从左往右滚动,但是当滚动进行到第二圈的时候,到第二张图片的时候是从右向左滚动,然后在从左向右滚动,往后每一圈的顺序都是这样的,但是设置startTurning(2000)的时候是正常的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.