所以我試圖用admob將一個簡單的廣告添加到我的應用中。我跟着SDK的教程,但遇到了一個錯誤。Android - Admob問題!
這裏的錯誤:
Multiple annotations found at this line:
- ERROR No resource identifier found for attribute 'secondaryTextColor' in package
'man.utd.headlines.man.utd'
- ERROR No resource identifier found for attribute 'primaryTextColor' in package 'man.utd.headlines.man.utd'
- ERROR No resource identifier found for attribute 'backgroundColor' in package 'man.utd.headlines.man.utd'
所以我想,這一定是我的包名稱的問題,但據我所看到的一切都OK。
在我的佈局文件我有以下幾點:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/man.utd.headlines.man.utd"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
但包的名稱似乎是正確的:
package man.utd.headlines.man.utd;
任何想法?這非常令人沮喪!
我也檢查了我的表現,並與這個包的名字都試過,但它仍然不能正常工作:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="man.utd.headlines"
任何幫助是極大的讚賞。
更新:通過更改軟件包名稱來解決,使它們更加一致 - 它們在主類和清單中完全一樣!
新問題:廣告不會顯示!
繼承人我佈局文件:
<?xml version="1.0" encoding="utf-8"?>
<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<com.admob.android.ads.AdView
android:id="@+id/ad"
android:layout_width="fill_parent"
android:layout_height="100px"
myapp:backgroundColor="#000000"
myapp:primaryTextColor="#FFFFFF"
myapp:secondaryTextColor="#CCCCCC" />
任何想法?任何幫助非常感謝:)。
感謝您的答覆,我解決了這個問題,但有一個新的,看看編輯!任何幫助是極大的讚賞。 – user319940 2010-08-31 23:12:15
我需要這個排序儘快,如果有人可以聘請糾正這一點,那麼我不介意花費少量的$$來得到這個工作。 – user319940 2010-09-01 00:00:42
將android:layout_height =「100px」 更改爲android:layout_height =「wrap_content」 並查看是否有效 – magicman 2010-09-02 02:12:56