我想让广告出现在预览中屏幕的左上角部分,它位于它应该在的位置,当我运行它时它永远不会出现在应用程序中。有人知道为什么吗?
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_img);
AdView adView = (AdView)this.findViewById(R.id.adView);
adView.loadAd(new AdRequest());
}
<RelativeLayout android:id="@+id/RelativeLayout01"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="2"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/imageView"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:layout_alignBottom="@+id/imageButton4"
android:layout_alignParentLeft="true"/>
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="xxxxxxx"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
android:layout_alignParentTop="true" android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/imageButton"/>
<ImageButton
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="fitCenter"
android:onClick="exit"
android:background="@null"
android:id="@+id/imageButton"
android:src="@drawable/deletebuttonbar2"
android:layout_alignParentTop="true" android:layout_alignParentRight="true"/>
<ImageButton
android:layout_width="70dp"
android:layout_height="70dp"
android:scaleType="fitCenter"
android:onClick="save"
android:background="@null"
android:src="@drawable/savebuttonbar3"
android:id="@+id/imageButton2"
android:layout_alignBottom="@+id/imageButton4" android:layout_toLeftOf="@+id/imageButton4"/>
<ImageButton
android:layout_width="72dp"
android:layout_height="72dp"
android:onClick="send"
android:scaleType="fitCenter"
android:background="@null"
android:src="@drawable/share"
android:id="@+id/imageButton3"
android:layout_alignParentBottom="true" android:layout_toRightOf="@+id/imageButton4"/><![CDATA[
android:layout_height="wrap_content" android:layout_toLeftOf="@+id/imageButton">
]]>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:id="@+id/imageButton4"
android:onClick="filter"
android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:paddingRight="10dp"/>
</RelativeLayout>