小编Ama*_*tam的帖子

导航到下一页时如何隐藏横幅广告?

我正在使用firebase_admob插件在 flutter 应用程序中设置广告。我尝试了横幅广告,它工作正常,但是,当我导航到另一个页面时,它仍然保持在原来的位置。我希望在导航到另一个页面时该广告应该隐藏。

代码片段如下。

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.smartBanner,
  targetingInfo: targetingInfo,
  listener: (MobileAdEvent event) {
    print("BannerAd event is $event");
  },
);
myBanner
  // typically this happens well before the ad is shown
  ..load()
  ..show(
    // Positions the banner ad 60 pixels from the bottom of the screen
    anchorOffset: 60.0,
    // Banner Position
    anchorType: AnchorType.bottom,
  );
Run Code Online (Sandbox Code Playgroud)

ads admob flutter

15
推荐指数
1
解决办法
2871
查看次数

如何在flutter中完成当前的视图/活动?

在android中有没有类似于this.finish()的方法来完成当前的颤振活动.

flutter

7
推荐指数
2
解决办法
6851
查看次数

如何在Kotlin中创建固定大小的IntArray并在以后初始化数组?

我只是在kotlin的初级水平.我没有任何办法在kotlin中为数组添加值.我想从用户获取值并将它们添加到数组中.

val arr = arrayOf<Int>()
Run Code Online (Sandbox Code Playgroud)

要么

var arr = intArrayOf()
Run Code Online (Sandbox Code Playgroud)

像在Java中一样

Scanner ob=new Scanner(System.in);
int arr[]=new int[5];
for(int i=0;i<arr.length;i++)
{
arr[i]=ob.nextInt();
}
Run Code Online (Sandbox Code Playgroud)

如何在kotlin中执行相同的操作?

arrays kotlin

6
推荐指数
1
解决办法
6067
查看次数

标签 统计

flutter ×2

admob ×1

ads ×1

arrays ×1

kotlin ×1