コンパイラが代わりにadmobsdk:
を使用してくださいあなたのmyapp:
を理解していません。
コード例を参照してください:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:admobsdk="http://schemas.android.com/apk/res/joke.content"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView android:id="@+id/photo" android:src="@drawable/joker"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
<RelativeLayout android:layout_height="wrap_content"
android:layout_width="wrap_content">
<TextView android:id="@+id/title" android:text=""
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textSize="24sp" android:textColor="@color/css_a"
android:layout_centerInParent="true" android:layout_alignParentTop="true"></TextView>
</RelativeLayout>
<ScrollView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_weight="1">
<TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:text="" android:id="@+id/content"
android:textSize="18sp" />
</ScrollView>
<RelativeLayout android:layout_height="wrap_content"
android:layout_width="fill_parent">
<Button android:text="下一篇" android:id="@+id/next"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_marginRight="15dip"
android:textSize="22sp"></Button>
</RelativeLayout>
<com.admob.android.ads.AdView android:id="@+id/ad"
android:layout_width="fill_parent" admobsdk:backgroundColor="#000000"
admobsdk:textColor="#FFFFFF" admobsdk:refreshInterval="60"
admobsdk:keywords="笑话" android:layout_height="wrap_content"
admobsdk:testing="false" admobsdk:isGoneWithoutAd="false" />
</LinearLayout>
前のコードでは、この行を持っていることを確認してください:
xmlns:admobsdk="http://schemas.android.com/apk/res/joke.content"
はあなたattrs.xmlをい(RESに/フォルダ値)のように見えるファイルこの:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
</declare-styleable>
</resources>
ない場合、XMLファイル名を作成し、あなたのres /値のフォルダにattrs.xmlと私にこのコードをコピーt。
joke.content
はあなたのパッケージ名です。パッケージ名に変更してください。
ただ、 'myappの変更:' 'admobsdkに:' – nnhthuan
は、私が何か間違ったことを見ていますか?コード内で「myapp」はどこですか? – Mich
'xmlns:admobsdk =" http://schemas.android.com/apk/res/joke.content "' – nnhthuan