我在市场上上传了一个应用,但广告只在平板电脑上显示,而不是在手机上显示。但后来我把手机倾斜而不是画像和广告?我不明白为什么这是我的xml文件
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/blue_final2"
>
<com.google.ads.AdView android:id="@+id/ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="ID"
ads:loadAdOnCreate="true"
ads:adSize="BANNER"
/>
<ScrollView android:layout_weight="30"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="9" >
<ImageButton
android:id="@+id/ibOne"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:src="@drawable/one"
android:background="@null"
android:layout_marginTop="60dp" />
<ImageButton
android:id="@+id/ibTwo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:src="@drawable/two"
android:background="@null"
android:layout_marginTop="60dp"/>
<ImageButton
android:id="@+id/ibThree"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="3"
android:src="@drawable/three"
android:background="@null"
android:layout_marginTop="60dp" />
</LinearLayout>
<TextView
android:id="@+id/textView1"
android:padding="30dp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Click on the picture you like the most and see your result!"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />
</LinearLayout>
</ScrollView>
</LinearLayout>
答案 0 :(得分:0)
我实际上已经明白了。这很简单......我只是将广告的宽度更改为wrap_content以匹配父级,一切正常!