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
