使棍的AdView到位滑动菜单时 [英] Make adview stick in place when sliding menu

查看:279
本文介绍了使棍的AdView到位滑动菜单时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Andr​​oid应用程序集成AdMob广告。我使用jfeinstein的滑动菜单,所以当我用它滑动,AdView的幻灯片了。我怎样才能使它贴在屏幕上,没有滑动菜单状态的事?

有些code:

 < com.google.ads.AdView
    的xmlns:广告=htt​​p://schemas.android.com/apk/lib/com.google.ads
    机器人:ID =@ + ID / AdView的
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =WRAP_CONTENT
    机器人:layout_alignParentBottom =真
    广告:adSize时=大旗
    广告:adUnitId设置=ID
    广告:loadAdOnCreate =真/>AD浏览=(的AdView)findViewById(R.id.adview);
adView.loadAd(新AdRequest中());


解决方案

尝试广告对准你的布局,而不是设置宽度,以填补父的左侧和右侧。 (像你想它会填充页面的底部,并从与滑动菜单滑动左右停止)。

我做这个,所以我知道它的工作原理的方式:)

I have integrated admob ads in my android application. I'm using jfeinstein's sliding menu, so when I slide it, adview slides with it too. How can I make it stick on the screen, no matter of sliding menu state?

Some code:

<com.google.ads.AdView
    xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
    android:id="@+id/adview"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    ads:adSize="BANNER"
    ads:adUnitId="ID"
    ads:loadAdOnCreate="true" />

adView = (AdView) findViewById(R.id.adview);
adView.loadAd(new AdRequest());

解决方案

Try aligning the advert to the left and right of your layout instead of setting width to fill parent. (It will fill the bottom of the page like you want and stop it from sliding around with the sliding menu).

I've done this so I know it works by the way :)

这篇关于使棍的AdView到位滑动菜单时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆