复制代码//安卓设置底部安全区域颜色
var Color = plus.android.importClass("android.graphics.Color");
plus.android.importClass("android.view.Window");
var mainActivity = plus.android.runtimeMainActivity();
var window_android = mainActivity.getWindow();
window_android.setNavigationBarColor(Color.parseColor('#FFFFFF'));
uni.navigateTo({
url: '/pages/moreReadPage/moreReadPage',
success: res => {},
fail: () => {},
complete: () => {}
});

- 发布:2023-09-09 11:27
- 更新:2023-09-09 11:48
- 阅读:569
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.8.12
手机系统: Android
手机系统版本号: Android 11
手机厂商: 小米
手机机型: 小米8
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
点击跳转时设置底部颜色,返回后再跳转跳转不了
点击跳转时设置底部颜色,返回后再跳转跳转不了
预期结果:
应该不要阻塞跳转
应该不要阻塞跳转
实际结果:
阻塞了,跳转错乱
阻塞了,跳转错乱
bug描述:
复制代码//安卓设置底部安全区域颜色
var Color = plus.android.importClass("android.graphics.Color");
plus.android.importClass("android.view.Window");
var mainActivity = plus.android.runtimeMainActivity();
var window_android = mainActivity.getWindow();
window_android.setNavigationBarColor(Color.parseColor('#FFFFFF'));
uni.navigateTo({
url: '/pages/moreReadPage/moreReadPage',
success: res => {},
fail: () => {},
complete: () => {}
});

李钊 (作者) - 李钊
复制代码<template>
<view>
<page-head :title="title"></page-head>
<view class="uni-padding-wrap uni-common-mt">
<view class="uni-btn-v">
<button type="default" @click="navigateTo">跳转到新页面</button>
<navigator url="redirect/redirect?title=redirect" open-type="redirect" hover-class="other-navigator-hover">
<button type="default">在当前页打开</button>
</navigator>
<navigator v-if="!hasLeftWin" url="/pages/tabBar/extUI/extUI" open-type="switchTab" hover-class="other-navigator-hover">
<button type="default">跳转tab页面</button>
</navigator>
</view>
</view>
</view>
</template>
<script>
import { mapState } from 'vuex'
export default {
data() {
return {
title: 'navigator'
}
},
computed: {
...mapState({
hasLeftWin: state => !state.noMatchLeftWindow
})
},
methods:{
navigateTo(){
//安卓设置底部安全区域颜色
var Color = plus.android.importClass("android.graphics.Color");
plus.android.importClass("android.view.Window");
var mainActivity = plus.android.runtimeMainActivity();
var window_android = mainActivity.getWindow();
window_android.setNavigationBarColor(Color.parseColor('#FFFFFF'));
uni.navigateTo({
url: 'navigate/navigate?title=navigate',
success: res => {},
fail: () => {},
complete: () => {}
});
}
}
}
</script>
使用官方的uniapp项目测试也是一样跳转不了
海角
你这个moreReadPage是nvue页面吧 换vue试试 或者不要在方法里面写
2024-11-01 16:25