0
我是Java和Android的初学者,我需要将admob广告放置在SurfaceView上方,它不起作用。有人可以帮我做到这一点吗?这是布局的代码:将admob广告放置在surfaceview上
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentTop="true"
ads:adSize="BANNER"
ads:adUnitId="a151e3f18d34b57"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID" />
<SurfaceView
android:id="@+id/preview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/gunmask" />
</RelativeLayout>
什么是 '不工作' 是什么意思?你得到了什么? –
广告正在发挥作用,但它是隐形的?我注意到它从堆栈跟踪 – user2558256