android - DoubleClick - Interstitial advertising sizing/cropping/center placing -> 不可能?

标签 android admob ads double-click interstitial

遵循此代码 ( https://developers.google.com/mobile-ads-sdk/docs/admob/advanced ):

import com.google.ads.*;

public class BannerExample extends Activity implements AdListener {

  private InterstitialAd interstitial;

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    // Create the interstitial
    interstitial = new InterstitialAd(this, MY_INTERSTITIAL_UNIT_ID);

    // Create ad request
    AdRequest adRequest = new AdRequest();

    // Begin loading your interstitial
    interstitial.loadAd(adRequest);

    // Set Ad Listener to use the callbacks below
    interstitial.setAdListener(this);
  }

  @Override
  public void onReceiveAd(Ad ad) {
    Log.d("OK", "Received ad");
    if (ad == interstitial) {
      interstitial.show();
    }
  }
}

我的图片(我的广告)比我的手机屏幕小。 我想知道是否可以调整在 java 代码中创建的 View 的大小。 (在 onCreate()onReceiveAd() 中)用于调整广告的大小。

LayoutParam,例如在 CenterCrop 中,或者简单地调整 View 大小!

最佳答案

如果您想从 DFP 向手机转换插页式广告,您可以在 DFP 中设置图片,并将尺寸替换为 320x480。然后可以转换该广告素材,并且可以根据需要缩小尺寸。

或者,您可能正在寻找横幅而不是占据整个屏幕的插页式叠加层。在这种情况下,您可以 specify a custom size对于您的 AdView,该尺寸应与您在 DFP 中设置的尺寸相匹配。

关于android - DoubleClick - Interstitial advertising sizing/cropping/center placing -> 不可能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16419729/

相关文章:

android - 在将admob gradle添加到android应用时,依赖冲突发生错误

android - 如果我只是运行我的应用程序并在我的测试设备上显示真实广告而不点击广告,我的 AdMob 帐户会被暂停吗?

ios - Flurry 广告 iOS 横幅被取消

ios - iAd付款细节

android - 当涉及到 Android 库项目时,Eclipse/ADT 有多聪明?

android - 如何将 Android 调试 keystore 放入颠覆存储库,然后让 Eclipse 使用它?

android - 在应用程序之间共享代码

android - 如何通过浏览器链接启动 Android 应用程序?

ios - 是否可以在全屏 UICollectionViewCell 上呈现 GADInterstitial?

ios - Admob 在伊朗的低填充率