Open Ellen2018 opened 6 years ago
第一次进去默认就是第一张图片往左滑动就到头了
只有一张图吗?
4张图,现在可以往左滑动了,有时候在运行中和第一次加载会报错 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.support.v7.widget.RecyclerView$LayoutManager.canScrollVertically()' on a null object reference at com.xuezj.cardbanner.view.CardView.findViewAtCenter(CardView.java:163) at com.xuezj.cardbanner.view.CardView.onLayout(CardView.java:67) 你能看下这个错误吗
我正在改这个问题
好的,感谢
这回应该好了
java.lang.AbstractMethodError: abstract method "void com.bumptech.glide.module.RegistersComponents.registerComponents(android.content.Context, com.bumptech.glide.Glide, com.bumptech.glide.Registry)" at com.bumptech.glide.Glide.initializeGlide(Glide.java:230) at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:171) at com.bumptech.glide.Glide.get(Glide.java:155) at com.bumptech.glide.Glide.getRetriever(Glide.java:528) at com.bumptech.glide.Glide.with(Glide.java:554) at com.xuezj.cardbanner.adapter.CardAdapter.onBindViewHolder(CardAdapter.java:82) at com.xuezj.cardbanner.adapter.CardAdapter.onBindViewHolder(CardAdapter.java:18) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6482) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6515) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5458) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5724) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5563) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5559) glide报错了,看一下
@GlideModule public class MyAppGlideModule extends AppGlideModule {
@Override
public boolean isManifestParsingEnabled() {
return false;
}
} 创建这个类。重写这个方法就好了,改一下吧
你是不是自己也引用Glide了
是的,有什么冲突吗?
嗯,这个问题我在项目中解决了
里面的原理是利用整形最大值作为适配器的数量大小,你是怎么滑到头的