广告不AdView中加载在横向模式的Andr​​oid [英] Ads are not loading in AdView in Landscape Mode Android

查看:217
本文介绍了广告不AdView中加载在横向模式的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在加载谷歌广告AdView中的横向模式。广告加载在纵向模式,但它不是在风景模式下加载。请帮助

I Want to load Google Ads in in AdView in Landscape mode. The ads are loading in Portrait mode but it is not loading in Landscape mode. Please Help

下面是我的code为XML:

Here is my code for xml:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:orientation="vertical"
tools:context=".MainActivity" >

     <WebView 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/web1"
    android:layout_weight="1"
    />

 <com.google.ads.AdView
    android:id="@+id/adView"
                     android:layout_width="wrap_content"
                     android:layout_height="fill_parent"
                     ads:adUnitId="a151c14ed73ec5f"
                     ads:adSize="SMART_BANNER"
                     ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"
                     android:gravity="center"     
                     ads:loadAdOnCreate="true"
                     android:layout_weight="9" />


</LinearLayout>

这code是用Java编写的:

And This code is written in Java:

AdView adView = (AdView)this.findViewById(R.id.adView);
    adView.loadAd(new AdRequest());

请回复!

AdView后显示的广告,但没有ARW在AdView中显示。

AdView is Showing but ads arw not shown in AdView.

推荐答案

您应该检查错误日志可能是你的AdView是没有得到其所需要适当的空间。

you should check the error log may be your adview is not getting proper space required for it..

这篇关于广告不AdView中加载在横向模式的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆