Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

只有黑背景没有viewpager显示 #18

Open
yuzhongrong opened this issue Oct 19, 2017 · 7 comments
Open

只有黑背景没有viewpager显示 #18

yuzhongrong opened this issue Oct 19, 2017 · 7 comments

Comments

@yuzhongrong
Copy link

List datas=new ArrayList();
//
// // for (XGPostBean.AdInfoBean info: ads.getAdInfo()) {
// for(int i=0;i<4;i++){
//
// //构造一个AdInfo
// // Logger.i("-----广告info------>"+info.getImg()+" "+info.getInformUrl()+" "+info
// // .getInformUrlType());
// AdInfo adinfo=new AdInfo();
// adinfo.setActivityImg("https://raw.githubusercontent.com/yipianfengye/android-adDialog/master/images/testImage1.png");
// adinfo.setTitle("了解详情");
// adinfo.setAdId(i+"");
// datas.add(adinfo);
//
// }
//
// AdManager adManager=new AdManager(getActivity(),datas);
//
// adManager.setOnImageClickListener(new AdManager.OnImageClickListener() {
// @OverRide
// public void onImageClick(View view, AdInfo advInfo) {
// Toast.makeText(getActivity(), "您点击了ViewPagerItem...", Toast.LENGTH_SHORT).show();
// }
// })
// .setPadding(100)
// .setWidthPerHeight(0.5f)
// .showAdDialog(AdConstant.ANIM_UP_TO_DOWN);

@yuzhongrong
Copy link
Author

我这样模拟加几个进去 只有背景没有内容

@yuzhongrong
Copy link
Author

default

@yuzhongrong
Copy link
Author

我模拟加了4组数据进去 但是广告无法显示
只有popwindow的一个背景

@yuzhongrong
Copy link
Author

人呢 作者呢

@chenxi0203
Copy link

里面有一个DisplayUtil,你在使用前应该先拿到屏幕的相关参数值设置进去。应该是这里没设置出现的这个问题。

@admingalery
Copy link

admingalery commented Apr 3, 2018

的确是@chenxi0203说的那样,作者的库里面的manifest文件设置了《application》,然后在LApplication文件里进行了初始化,如果我们直接引用作者的库,会报错,下载该库,用import的方式作为module引入,删除manifest文件的《application》标签,然后在AdManager构造方法里面进行初始化(LApplication的初始化方法拷贝过来)

@yecaler
Copy link

yecaler commented Jun 26, 2018

棒棒哒!已成功解决!。
按照作者的步骤,进去以后,可能会出现com.facebook.drawee.view.SimpleDraweeView这个找不到的问题。需要在MyApplication文件中加入
Fresco.initialize(this);
然后如果出现上述情况,需要在MyApplication中加入
private void initDisplayOpinion() {
DisplayMetrics dm = getResources().getDisplayMetrics();
DisplayUtil.density = dm.density;
DisplayUtil.densityDPI = dm.densityDpi;
DisplayUtil.screenWidthPx = dm.widthPixels;
DisplayUtil.screenhightPx = dm.heightPixels;
DisplayUtil.screenWidthDip = DisplayUtil.px2dip(getApplicationContext(), dm.widthPixels);
DisplayUtil.screenHightDip = DisplayUtil.px2dip(getApplicationContext(), dm.heightPixels);
}
这段代码并调用。
我这儿成功解决!记录以感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants