ionicframework admob在视图的底部

时间:2015-06-19 07:08:57

标签: admob ionic-framework

我有这个视图代码:

<ion-view view-title="Video divertenti">
  <ion-content on-swipe-left2="swipeLeft($index);" on-swipe-right2="swipeRight($index);">
      <ion-slide-box show-pager="false" on-slide-changed="cambiaVideo($index);">

      <ion-slide ng-repeat="item in lista track by item.nid">
          <div id="immaginiBox" >
              <div class="titolo">{{item.titolo}}</div>
              <blockquote class="desc" ng-show="item.desc != null"> {{item.desc}}</blockquote>
                <img id="thumb_{{$index}}" ng-click="playVideo($index)" style="width:100%;">
                <video style="display:none;" video-reset id="video_{{$index}}" ng-src2="{{item.videoT}}" controls="" width="100%" height="300px"></video>
          </div>
      </ion-slide>
      </ion-slide-box>
  </ion-content>

    <ion-footer-bar align-title="left" class="bar bar-footer">
        [MY TABS]
    </ion-footer-bar>

</ion-view>

这个代码在我视图的控制器中(对于Admob):

$scope.$on('$ionicView.loaded',function(eve) {
        if(AdMob) {
            AdMob.prepareInterstitial({adId: ApiEndpoint.admobid.interstitial, autoShow: false});

            AdMob.createBanner({
                    adId: ApiEndpoint.admobid.banner,
                    adSize: AdMob.AD_SIZE.BANNER,
                    bannerAtTop: false,
                },
                function () {

                    AdMob.requestAd(
                        {'isTesting': false},
                        function () {
                            AdMob.showAd(true);
                        },
                        function () {
                            console.log('failed to request ad');
                        }
                    );
                },
                function () {
                    console.log('failed to create banner view');
                }
            );
        }
    });

但我不明白为什么admob设置在视图的顶部而不是底部(此图像来自ios模拟器):

screehshot from emulator

1 个答案:

答案 0 :(得分:0)

添加以下行:

AdMob.showBanner(AdMob.AD_POSITION.BOTTOM_CENTER);