Blogger Information
Blog 52
fans 1
comment 1
visits 38662
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1、安装小程序开发者工具 2、配置小程序底部按钮、顶部窗口 3、根据底部按钮,创建对应页面 4、列出10个组件的使用方法
小丑0o鱼
Original
434 people have browsed it

1、安装小程序开发者工具

前往 开发者工具下载页面 (https://developers.weixin.qq.com/miniprogram/dev/devtools/download.html) 根据自己的操作系统下载对应的稳定版安装包进行安装

2、配置小程序底部按钮、顶部窗口
在小程序app.json下,window下配置顶部窗口navigation与底部按钮tabBar

window 配置项

  1. navigationBarBackgroundColor HexColor #000000 导航栏背景颜色,如 #000000
  2. navigationBarTextStyle string white 导航栏标题颜色,仅支持 black / white
  3. navigationBarTitleText string 导航栏标题文字内容
  4. backgroundColor HexColor #ffffff 窗口的背景色
  5. backgroundTextStyle string dark 下拉 loading 的样式,仅支持 dark / light

tabBar 配置项

  1. pagePath string 页面路径,必须在 pages 中先定义
  2. text string tab 上按钮文字
  3. iconPath string 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
  4. selectedIconPath string 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,不支持网络图片。
  1. "window": {
  2. "navigationBarBackgroundColor": "#ffffff",
  3. "navigationBarTextStyle": "black",
  4. "navigationBarTitleText": "默默记账",
  5. "backgroundColor": "#eeeeee",
  6. "backgroundTextStyle": "light",
  7. "enablePullDownRefresh": false
  8. },
  9. "tabBar": {
  10. "color": "#444444",
  11. "selectedColor": "red",
  12. "backgroundColor": "#ffffff",
  13. "position": "bottom",
  14. "borderStyle": "black",
  15. "list": [{
  16. "pagePath": "pages/index/index",
  17. "text": "主页",
  18. "iconPath": "./static/img/1.png",
  19. "selectedIconPath": "./static/img/2.png"
  20. },
  21. {"pagePath": "pages/ad/ad",
  22. "text": "广告",
  23. "iconPath": "./static/img/1.png",
  24. "selectedIconPath": "./static/img/2.png"
  25. },
  26. {"pagePath": "pages/art/art",
  27. "text": "文章",
  28. "iconPath": "./static/img/3.png",
  29. "selectedIconPath": "./static/img/4.png"
  30. },
  31. {
  32. "pagePath": "pages/logs/logs",
  33. "text": "日志",
  34. "iconPath": "./static/img/3.png",
  35. "selectedIconPath": "./static/img/4.png"
  36. }
  37. ]
  38. }
  39. }
Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post