banner 广告无法设置 top 和宽度,一直渲染兜底广告
97 浏览2026年07月06日作者:challenchen

const targetBannerAdWidth = 300;

// 创建一个居于屏幕底部正中的广告

let bannerAd = tt.createBannerAd({

adUnitId: "xxxxx",

style: {

width: targetBannerAdWidth,

top: 40,

},

});

bannerAd.onLoad(() => {

bannerAd

.show()

.then(() => {

console.log("广告显示成功");

console.log('bannerAd', bannerAd.style)

})

.catch((err) => {

console.log("广告组件出现问题", err);

});
})

参考官方用例设置,但是一直渲染兜底广告,而且无法设置 top 和 width

最后一次编辑于 2026 年 07 月 06 日
共 3 条评论

相关问答

专题推荐

热门文章

热门问答