如何在 Flutter 中降低 AdMob 的 BannerAd 高度?

How to decrease the height of BannerAd of AdMob in Flutter?

I've implemented firebase_admob 包在我的应用程序上。当我在屏幕底部显示广告时,它需要很大的 space(大高度),这是我在任何其他应用程序中都没有见过的。我怎样才能降低 BannerAd 的高度?

阅读官方DOCS:

Limitations

This plugin currently has some limitations:

  • Banner ads cannot be animated into view.
  • It's not possible to specify a banner ad's size.
  • There's no support for native ads.
  • The existing tests are fairly rudimentary.
  • There is no API doc.
  • The example should demonstrate how to show gate a route push with an interstitial ad

如果您使用智能横幅,它会根据设备高度调整高度, 所以如果你想要一个小横幅,请不要使用 smartBanner,而是使用横幅。

横幅的固定高度为 50。

尺码:AdSize.banner

  BannerAd myBanner = BannerAd(
      // Replace the testAdUnitId with an ad unit id from the AdMob dash.
      // https://developers.google.com/admob/android/test-ads
      // https://developers.google.com/admob/ios/test-ads
      adUnitId: BannerAd.testAdUnitId,
      size: AdSize.banner,
      targetingInfo: targetingInfo,
      listener: (MobileAdEvent event) {
        print("BannerAd event is $event");
      },
    );