uni-app AD广告浮动始终在最上面不跟随scroll-view滚动
uni-app AD广告浮动始终在最上面不跟随scroll-view滚动
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
Mac | 1 | HBuilderX |
### 操作步骤:
```html
<scroll-view>
<view >
<ad adpid="1111111111" [@load](/user/load)="onload" [@close](/user/close)="onclose" [@error](/user/error)="onerror" [@downloadchange](/user/downloadchange)="ondownloadchange"></ad>
</view>
</scroll-view>
预期结果:
正常
实际结果:
时隐时现 卡顿 浮动到了最顶层
bug描述:
AD广告 iosapp上 为什么会总是浮动啊?不应该随着滚动吗?
<scroll-view>
<view >
<ad adpid="1111111111" [@load](/user/load)="onload" [@close](/user/close)="onclose" [@error](/user/error)="onerror" [@downloadchange](/user/downloadchange)="ondownloadchange"></ad>
</view>
</scroll-view>
不跟随scroll-view滚动 卡顿 时隐时现
更多关于uni-app AD广告浮动始终在最上面不跟随scroll-view滚动的实战教程也可以访问 https://www.itying.com/category-93-b0.html
5 回复
ad是原生组件,在vue页面里层级是独立的。
除非在nvue里才能拉平层级
更多关于uni-app AD广告浮动始终在最上面不跟随scroll-view滚动的实战教程也可以访问 https://www.itying.com/category-93-b0.html
那怎么办 必须放在nvue里? 页面不是nvue 不想弄nvue 我怎么才能在普通页面跟随页面滚动 不浮动呀
回复 270315475: 要不nvue,要不别放到swiper、scroll-view里
回复 DCloud_heavensoft: 没放到swiper、scroll-view里也浮动。。。
这是一个常见的uni-app广告组件在iOS上的显示问题。主要原因如下:
-
iOS平台的原生广告组件默认是以悬浮窗形式展示的,这是平台特性导致的
-
解决方案可以尝试以下几种方式:
- 使用position:static样式强制广告跟随文档流
<ad style="position:static"></ad>
- 或者给外层view添加固定高度
<view style="height:300px">
<ad></ad>
</view>