7449 / BannerLayout

Support unlimited picture rotation BannerLayout, the minimum implementation of the code banner
Apache License 2.0
93 stars 20 forks source link

initTip()报错 #8

Closed HeJingWei closed 7 years ago

HeJingWei commented 7 years ago

mShopVp.initListResources(data) .setImageLoaderManager(new ImageManager()) .initTips(true,true,false) .setOnBannerClickListener(new OnBannerClickListener() { @Override public void onBannerClick(View view, int position, ShopViewPagerModel model) { / 广告页点击事件 /

                            }
                        })
                        .start(true,4000);

以上代码运行,在initTip处会报错 android.content.res.Resources$NotFoundException: Resource ID #0x0 如果用initTip()代替initTips(true,true,false)就能正常运行

7449 commented 7 years ago

你clone下看Demo,Adapter第一个Type,看报错没有,如果报错了希望能说下机型和android版本,我测试是没有问题 @CaoFanTian

HeJingWei commented 7 years ago

哥们我明天看看给你提交哈

7449 commented 7 years ago

ok

HeJingWei commented 7 years ago

demo运行的程序没有报错 我的手机是努比亚,导入报错的版本是4.4和6.0

7449 commented 7 years ago

你确定依赖的是最新的版本 1.0.6 吗? 之前确实有一个版本判断出错导致会#0x0 @CaoFanTian

HeJingWei commented 7 years ago

compile 'com.ydevelop:bannerlayout:1.0.6' gradle是这样依赖的

7449 commented 7 years ago

@你如果在手机上运行Sample没有报错,那就不是我这边的问题,应该检查你的代码, @CaoFanTian

HeJingWei commented 7 years ago

compile 'com.ydevelop:bannerlayout:1.0.6' 依赖是这样的,没有错吧

7449 commented 7 years ago

嗯 依赖是最新的,如果你不确定你的代码哪里有问题,可以贴上完整的Log,只一句Resources$NotFoundException我也不能确定哪里有问题 @HeJingWei

HeJingWei commented 7 years ago

xml中: <com.bannerlayout.widget.BannerLayout android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/shop_vp" app:delay_time="4" app:tips_background="@color/translate" app:dots_selector="@drawable/dot_selector" app:dots_site="centered" app:banner_duration="200" /> 代码中: if (data != null) { mShopVp.initListResources(data) .setImageLoaderManager(new ImageManager()) .initTips(true,true,false) .setOnBannerClickListener(new OnBannerClickListener() { @Override public void onBannerClick(View view, int position, ShopViewPagerModel model) { / 广告页点击事件 /

                            }
                        })
                        .start(true,4000);
            }

data集合的对象是继承了BannerModel的

7449 commented 7 years ago

app:tips_background="@color/translate" 这句报错 要不等我把这个问题修复,再走一边所有属性设置,更新到1.0.7,要不就先在代码里设置背景颜色 多谢反馈Bug,Thanks @HeJingWei

HeJingWei commented 7 years ago

OK,辛苦