小程序学习笔记(4)-猫眼电影案例

第一步:创建新的项目

在这里插入图片描述
在这里插入图片描述

第二步:更改app.json,进行基本的样式变更

在这里插入图片描述

第三步:了解app.json可以设置的更多的东西

1,配置页面路径
2,配置窗口表现
3,配置标签导航
4,配置网络超时
5,配置debug模式

官方文档:https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html

1,配置底部tab导航

在这里插入图片描述

2,转化为顶部导航栏

只需要多配置一行话:position:"top"便可,因为默认是buttom,切换成顶部之后,图片会消失。
在这里插入图片描述
于是实现的效果:
在这里插入图片描述

四,app.json完整代码:

{
  "pages":[
    "pages/movie/movie",
    "pages/cinema/cinema",
    "pages/find/find",
    "pages/me/me"
  ],
  "window":{
    "backgroundTextStyle":"light",
    "navigationBarBackgroundColor": "#D53e37",
    "navigationBarTitleText": "猫妖电影",
    "navigationBarTextStyle":"white"
  },
  "tabBar":{
    "selectedColor": "#D53e37",
    "backgroundColor": "#f5f5f5",
    "borderStyle": "white",
    "position": "bottom",
    "list": [{
      "pagePath":"pages/movie/movie",
      "text":"电影",
      "iconPath":"images/bar/movie-0.jpg",
      "selectedIconPath":"images/bar/movie-1.jpg"
    },
    {
      "pagePath":"pages/cinema/cinema",
      "text":"影院",
      "iconPath":"images/bar/cinema-0.jpg",
      "selectedIconPath":"images/bar/cinema-1.jpg"
    },
    {
      "pagePath":"pages/find/find",
      "text":"发现",
      "iconPath":"images/bar/find-0.jpg",
      "selectedIconPath":"images/bar/find-1.jpg"
    },
    {
      "pagePath":"pages/me/me",
      "text":"我的",
      "iconPath":"images/bar/me-0.jpg",
      "selectedIconPath":"images/bar/me-1.jpg"
    }
  ]

  },
  "style": "v2",
  "sitemapLocation": "sitemap.json"
}

  • 0
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值