1. 将菜单素材放入项目,images文件夹与pages同目录
![](https://box.kancloud.cn/05dff2a13169c879db98aa85f9177255_908x325.png)
![](https://box.kancloud.cn/1056819574f146411a44dd5c0a4f6ba9_276x438.png)
app.json代码
```
{
"pages": ["pages/movie/movie", "pages/profile/profile"],
"window": {
"backgroundColor": "#f6f6f6",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#e54847",
"navigationBarTitleText": "最新电影",
"navigationBarTextStyle": "white"
},
"tabBar": {
"color": "#000000",
"selectedColor": "#e54847",
"list": [{
"pagePath": "pages/movie/movie",
"text": "电影",
"iconPath": "images/film.png",
"selectedIconPath": "images/film-actived.png"
},
{
"pagePath": "pages/profile/profile",
"text": "我的",
"iconPath": "images/profile.png",
"selectedIconPath": "images/profile-actived.png"
}]
}
}
```
效果:
![](https://box.kancloud.cn/40f96caf57f3d157c893a0ee6344a119_433x740.png)
注意:app.json中不能有注释
否则会报错:
![](https://box.kancloud.cn/4198cd80ca9e298778f22034c1afa812_1254x619.png)