收藏
回答

CustomAd 格子广告位置异常

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小游戏 Bug CustomAd 微信iOS客户端 7.0.12 2.11.2
let info = wx.getSystemInfoSync();
if(compareVersion(info.SDKVersion, '2.11.1') >= 0){
    if(!this._adObj){
        this._state = AdState.LOADING
        let obj = {
            adUnitId: this._adUnitId,
            adIntervals: Number(this._intervals),
            style: {
                left: 0,
                top: info.screenHeight / 2,
                fixed: false
            }
        }
        console.log(obj)
        this._adObj = wx.createCustomAd(obj);
        this._adObj.onError((this.onError).bind(this));
        this._adObj.onLoad((this.onLoad).bind(this));
    }
    return true
}
else{
    this._state = AdState.ERROR
    this.onError('SDK版本过低:'+ info.SDKVersion)
}


无论怎么设置style的值,就是显示在左上角!

最后一次编辑于  2021-09-24
回答关注问题邀请回答
收藏

1 个回答

  • Forever
    Forever
    2021-09-24
    你console.log(obj)的内容是什么?
    


    2021-09-24
    有用
    回复
登录 后发表内容