Vid*_*nes 2 testing sdk android admob
我正在测试Android SDK的AdMob.我无法设置admob:testing="true"因为admob属性未知.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:admob="http://schemas.android.com/apk/res/org.ifies.android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#FF000000"
android:clickable="true"
>
<com.admob.android.ads.AdView
android:id="@+id/admob"
android:visibility="visible"
android:layout_width="fill_parent"
android:layout_height="100px"
android:background="#FF0000"
admob:testing="true"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
我的Eclipse抱怨admob:testing="true"说它有一个未知的前缀.有人知道如何解决这个问题吗?
子问题:任何人都知道如何更改广告的高度?它似乎固定为48px,在任何DROID手机上看起来都不太好......
我花了一段时间才弄明白,所以我在这里发帖子:
由于AdMob 4.1已更改,因此上一个答案对于<= 4.04版本是正确的.现在你需要使用:
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
Run Code Online (Sandbox Code Playgroud)
在新架构中没有自己的包的位置,也不需要attrs.xml文件.
详情请访问:http://groups.google.com/group/google-admob-ads-sdk/browse_thread/thread/3b885d3fe5bb21a5?pli = 1(蒂姆的帖子,它是排名第8位)
可能值得检查错误不是由文件外的东西引起的:
确保您在架构URI中使用的包名称"org.ifies.android"与AndroidManifest.xml中清单元素上的package属性值相匹配.
确保res/values/attrs.xml具有指定的属性:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="testing" format="boolean" />
<attr name="backgroundColor" format="color" />
<attr name="textColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
<attr name="isGoneWithoutAd" format="boolean" />
</declare-styleable>
</resources>
Run Code Online (Sandbox Code Playgroud)