dcloudio / dcloudio/uni-app

android的暗黑模式下backgroundImage不改变

Open
#5,666 1 comment 0 reactions 0 assignees View on GitHub
app
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

### 发行方式

App

### 具体平台

Android 15

### 开发环境

Windows

### 项目创建方式

HBuilderX

### 依赖版本

HBuilderX 4.75

### 问题描述

ios下切换暗黑模式backgroundImage正常改变,安卓下无法正常改变,始终为明亮模式下的图片
``` json
"tabBar": {
"color": "@tabFontColor",
"selectedColor": "@tabSelectedColor",
"backgroundImage": "@tabbarBackgroundImage",
"borderStyle": "@tabBorderStyle",
"backgroundColor": "@tabBgColor",
"list": [{
"text": "首页",
"pagePath": "pages/index/index",
"iconPath": "static/home.png",
"selectedIconPath": "static/home_select.png"
},
{
"text": "我的",
"pagePath": "pages/mine/index",
"iconPath": "static/mine.png",
"selectedIconPath": "static/mine_select.png"
}
],
"midButton": {
"iconPath": "/static/tab-icon/1.png",
"height": "85px",
"iconWidth": "70px"
}
},
```
``` json
{
"light": {
"navTxtStyle": "black",
"navBgColor": "#FFFFFF",
"bgColor": "#FFFFFF",
"tabFontColor": "#909399",
"tabSelectedColor": "#68CCAA",
"mineBackgroundImage": "linear-gradient(to bottom, #D8FEF1, #eafef7)",
"salePageBackgroundImage": "linear-gradient(to bottom, #D8FEF1, #eafef7)",
"tabbarBackgroundImage": "static/tabbar_background_2.png",
"tabBgColor": "#F7F7F7",
"tabBorderStyle": "white"
},
"dark": {
"navTxtStyle": "white",
"navBgColor": "#121212",
"bgColor": "#121212",
"tabFontColor": "#8E8E93",
"tabSelectedColor": "#7DD3AF",
"mineBackgroundImage": "linear-gradient(to bottom, #2A4435, #243A2F)",
"salePageBackgroundImage": "linear-gradient(to bottom, #1a2e24, #243530)",
"tabbarBackgroundImage": "static/tabbar_background_3.png",
"tabBgColor": "#1F1F1F",
"tabBorderStyle": "black"
}
}
```

### 重现步骤

1. 使用[官方示例](https://ext.dcloud.net.cn/plugin?name=hello-darkmode)
2. 修改tabbar,使用"backgroundImage": "@tabbarBackgroundImage",在theme.json添加tabbarBackgroundImage
3. 复现

### 期望行为

在android变为暗黑模式后,tabbar的背景图片正常改变为暗黑模式下的背景图片

### 实际行为

tabbar的背景图片一直为明亮模式下的背景图片

### 截图或录屏

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.