微信小程序开发中窗口底部tab栏切换页面很简单很方便.
代码:
1.app.json
//app.json { "pages":[ "pages/index/index", "pages/logs/logs" ], "window":{ "backgroundtextstyle":"light", "navigationbarbackgroundcolor": "#999999", "navigationbartitletext": "tab", "navigationbartextstyle":"white" }, "tabbar": { "color": "#ccc", "selectedcolor": "#35495e", "borderstyle": "white", "backgroundcolor": "#f9f9f9", "list": [ { "text": "首页", "pagepath": "pages/index/index", "iconpath": "images/home.png", "selectediconpath": "images/home-actived.png" }, { "text": "目录", "pagepath": "pages/catalogue/catalogue", "iconpath": "images/note.png", "selectediconpath": "images/note-actived.png" }, { "text": "我的", "pagepath": "pages/mine/mine", "iconpath": "images/profile.png", "selectediconpath": "images/profile-actived.png" } ] } }
pagepath是页面路径.iconpath是图片路径,icon 大小限制为40kb.
selectediconpath:选中时的图片路径,icon 大小限制为40kb
tab bar的最多5个,最少2个.
在pages目录下写好页面即可切换.
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持移动技术网!
如对本文有疑问, 点击进行留言回复!!
MFC的静态库.lib、动态库.dll(包含引入库.lib)以及Unicode库示例
CTF 刷题记录(一) 白云新闻搜索(手动与自动化SQL注入)
javascript如何使用函数random来实现课堂随机点名方法详解
网友评论