zoukankan      html  css  js  c++  java
  • ⑩ 自定义tabbar

    • tabBar 为自定义组件:推荐使用 fixed 在底部的 cover-view + cover-image 组件渲染样式,以保证 tabBar 层级相对较高
    • 每个 tab 页下的自定义 tabBar 组件实例是不同的,可通过自定义组件下的 getTabBar 接口获取当前页面的自定义 tabBar 组件实例

    使用流程

    1 配置信息

    • 在 app.json 中的 tabBar 项指定 custom 字段。
    • 所有 tab 页的 json 里需声明 usingComponents 项,也可以在 app.json 全局开启。
    {
      "tabBar": {
        "custom": true,
        "color": "#000000",
        "selectedColor": "#000000",
        "backgroundColor": "#000000",
        "list": [{
          "pagePath": "page/component/index",
          "text": "组件"
        }, {
          "pagePath": "page/API/index",
          "text": "接口"
        }]
      },
      "usingComponents": {}
    }
    

    2 添加 tabBar 代码文件

    在代码根目录下添加入口文件:

    • custom-tab-bar/index.js
    • custom-tab-bar/index.json
    • custom-tab-bar/index.wxml
    • custom-tab-bar/index.wxss

    3 编写 tabBar 代码

  • 相关阅读:
    附加:CSS大全
    HTML 三
    HTML 二
    HTML 一
    20150106--SQL事务操作+触发器二
    20150106--SQL事务操作+触发器一
    20141229 mysql基本操作二
    Oracle基础知识
    JDBC事务
    jsp内置/隐式对象(9个)与el表达式
  • 原文地址:https://www.cnblogs.com/pleaseAnswer/p/15394081.html
Copyright © 2011-2022 走看看