微信小程序之配置app.json

{

  "pages": [
    "pages/index/index",
    "pages/perInfo/updateInfo/updateInfo",
    "pages/help/help"
  ],
  "window": {
    "backgroundColor": "#F6F6F6",
    "backgroundTextStyle": "light",
    "navigationBarBackgroundColor": "#FF8C00",
    "navigationBarTitleText": "云图书",
    "navigationBarTextStyle": "white"
  },
  "tabBar": {
    "list": [
      {
        "pagePath": "pages/index/index",
        "text": "首页",
        "iconPath": "images/icon-home/find.png",
        "selectedIconPath": "images/icon-home/find1.png"
      },
      {
        "pagePath": "pages/scan/scan",
        "text": "扫一扫",
        "iconPath": "images/icon-home/scan.png",
        "selectedIconPath": "images/icon-home/scan1.png"
      },
      {
        "pagePath": "pages/my/my",
        "text": "我的",
        "iconPath": "images/icon-home/my.png",
        "selectedIconPath": "images/icon-home/my1.png"
      }
    ]
  },
  "sitemapLocation": "sitemap.json",
  "cloud": true
}

上面的pages里面写入页面路径后,程序会在pages目录下自动生成相应的页面,无需自己手动添加
navigationBarTitleText:标题
navigationBarBackgroundColor:设置标题背景色
navigationBarTextStyle:标题字体的颜色

其中下面的tabBar中的list至少添加两项
pagePath:目标路径
text:小标题
iconPath:初始照片路径
selectedIconPath:被点击选择后所变化的图片路径,一般与iconPath的图片相同,只是颜色不同

关于透明图片大家可以到 “阿里巴巴矢量库”取搜索自己喜欢的图标,当然也可以通过ps去制作。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐