前端代码:可以显示本地图片的,但是编译成android 代码路径就找不到了
"tabBar": {
"color": "#999999",
"selectedColor": "#ff0000",
"fontSize": "18px",
"backgroundColor": "#FFFFFF", // 背景色
"borderStyle": "black", // 边框样式
"list": [
{
"pagePath": "pages/index/index", // 页面路径
"text": "首页", // 文字
"iconPath": "/static/tabbar/main_ic_index.png", // 默认图标
"selectedIconPath": "/static/tabbar/main_ic_indexd.png" // 选中图标
},
{
"pagePath": "pages/setting/setting",
"text": "我的",
"iconPath": "/static/tabbar/main_ic_user.png",
"selectedIconPath": "/static/tabbar/main_ic_userd.png"
}
]
},
下面是kotlin 的代码 static/tabbar/main_ic_userd.png 最前面 加不加 / 都加载不到
return utsMapOf("color" to "#999999", "selectedColor" to "#ff0000", "fontSize" to "18px", "backgroundColor" to "#FFFFFF", "borderStyle" to "black", "list" to utsArrayOf(
utsMapOf("pagePath" to "pages/index/index", "text" to "首页", "iconPath" to "static/tabbar/main_ic_index.png", "selectedIconPath" to "static/tabbar/main_ic_indexd.png"),
utsMapOf("pagePath" to "pages/setting/setting", "text" to "我的", "iconPath" to "static/tabbar/main_ic_user.png", "selectedIconPath" to "static/tabbar/main_ic_userd.png")
))