use*_*687 1 android ads banner admob android-linearlayout
我想在LinearLayout中添加第二个广告横幅,但是插入第二个横幅时我的应用程序崩溃。将外部横幅插入RelativeLayout效果很好,但是我想在ScrollView内添加第二个。我该怎么办?这是我的代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000" >
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
/>
<ToggleButton
/>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
ads:adSize="BANNER"
ads:adUnitId="xxxxxxxx"
ads:loadAdOnCreate="true"
>
</com.google.ads.AdView>
</LinearLayout>
</ScrollView>
<com.google.ads.AdView
android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="xxxxxxxxx"
ads:loadAdOnCreate="true"
>
</com.google.ads.AdView>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3239 次 |
| 最近记录: |