zoukankan      html  css  js  c++  java
  • uni-app中的tabBar配置

    配置tabbar

    如果应用是一个多 tab 应用,可以通过 tabBar 配置项指定 tab 栏的表现,以及 tab 切换时显示的对应页。

    Tips

    • 当设置 position 为 top 时,将不会显示 icon
    • tabBar 中的 list 是一个数组,只能配置最少2个、最多5个 tab,tab 按数组的顺序排序。

    属性说明:

    属性 类型 必填 默认值 描述 平台差异说明
    color HexColor tab 上的文字默认颜色
    selectedColor HexColor tab 上的文字选中时的颜色
    backgroundColor HexColor tab 的背景色
    borderStyle String black tabbar 上边框的颜色,仅支持 black/white App 2.3.4+ 支持其他颜色值
    list Array tab 的列表,详见 list 属性说明,最少2个、最多5个 tab
    position String bottom 可选值 bottom、top top 值仅微信小程序支持

    其中 list 接收一个数组,数组中的每个项都是一个对象,其属性值如下:

    属性 类型 必填 说明
    pagePath String 页面路径,必须在 pages 中先定义
    text String tab 上按钮文字,在 5+APP 和 H5 平台为非必填。例如中间可放一个没有文字的+号图标
    iconPath String 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片,不支持字体图标
    selectedIconPath String 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效

    案例代码:

    "tabBar": {
    		"list": [
    			{
    				"text": "首页",
    				"pagePath":"pages/index/index",
    				"iconPath":"static/tabs/home.png",
    				"selectedIconPath":"static/tabs/home-active.png"
    			},
    			{
    				"text": "信息",
    				"pagePath":"pages/message/message",
    				"iconPath":"static/tabs/message.png",
    				"selectedIconPath":"static/tabs/message-active.png"
    			},
    			{
    				"text": "我们",
    				"pagePath":"pages/contact/contact",
    				"iconPath":"static/tabs/contact.png",
    				"selectedIconPath":"static/tabs/contact-active.png"
    			}
    		]
    	}
    
  • 相关阅读:
    赤手空拳破解WINDOWS系统密码
    几扇鲜为人知的Windows XP自动运行后门
    Enumerating Logon Sessions
    用浏览器控件做界面,网页界面中定义自己的程序事件
    P2P之UDP穿透NAT的原理与实现(附源代码)
    delphi调用c#写的webservice中文出现乱码的问题
    基于Delphi的DirectShow开发概述
    视频捕获软件开发完全教学
    GINA 模块定义文件(Windows XP)
    GINA后门代码
  • 原文地址:https://www.cnblogs.com/Acapplella/p/15100355.html
Copyright © 2011-2022 走看看