uni-app "bounce": "none" nvue ios 无效
uni-app “bounce”: “none” nvue ios 无效
开发环境 | 版本号 | 项目创建方式 |
---|---|---|
Windows | 10.14.5 | HBuilderX |
iOS | iOS 13.4 | |
苹果 | X |
示例代码:
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app-plus": {
"titleView": false,
"bounce":"none"
}
}
}
操作步骤:
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app-plus": {
"titleView": false,
"bounce":"none"
}
}
}
预期结果:
关闭回弹效果
实际结果:
无法关闭
bug描述:
全局"bounce": "none" 和局部设置"bounce": "none" ios均无效 仍然有回弹效果
更多关于uni-app "bounce": "none" nvue ios 无效的实战教程也可以访问 https://www.itying.com/category-93-b0.html
2 回复
{
“path”: “pages/home/index”,
“style”: {
“navigationBarTitleText”: “”,
“disableScroll”: true,//关闭回弹必须添加这个和这个
“navigationStyle”: “custom”,
“app-plus”: {
“titleView”: false,
“bounce”:“none”
}
}
}
已经解决
更多关于uni-app "bounce": "none" nvue ios 无效的实战教程也可以访问 https://www.itying.com/category-93-b0.html
针对uni-app中nvue页面在iOS上设置"bounce": "none"
无效的问题,以下是解决方案:
- 对于nvue页面,需要在页面配置中单独设置
bounce
属性:
{
"path": "pages/home/index",
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"app-plus": {
"titleView": false,
"bounce": "none"
},
"nvue": {
"bounce": "none"
}
}
}
- 如果仍然无效,可以在页面的
onLoad
生命周期中添加以下代码:
onLoad() {
// iOS平台额外处理
if (uni.getSystemInfoSync().platform === 'ios') {
const pages = getCurrentPages()
const page = pages[pages.length - 1]
page.$getAppWebview().setStyle({
bounce: 'none'
})
}
}