廢話少說,能看懂就看,看不懂路過,解釋了你也未必懂,直接上代碼。
效果圖:

這個demo需要6張圖片:

做好好三個界面并注冊,界面的數(shù)量要大于1小于6:

app.json代碼:
{
? "pages":[
? ? "pages/index/index",
? ? "pages/index2/index2",
? ? "pages/index3/index3"
? ],
? "window":{
? ? "backgroundTextStyle":"light",
? ? "navigationBarBackgroundColor": "#fff",
? ? "navigationBarTitleText": "tabBar",
? ? "navigationBarTextStyle":"black"
? },
? "tabBar": {
? ? "position":"bottom",
? ? "borderStyle":"white",
? ? "list": [
? ? ? {
? ? ? ? "pagePath": "pages/index/index",
? ? ? ? "text": "閱讀",
? ? ? ? "iconPath":"/images/ciwei.png",
? ? ? ? "selectedIconPath":"/images/ciwei_hl.png"
? ? ? },
? ? ? {
? ? ? ? "pagePath": "pages/index2/index2",
? ? ? ? "text": "電影",
? ? ? ? "iconPath": "/images/dianying.png",
? ? ? ? "selectedIconPath": "/images/dianying_hl.png"
? ? ? },
? ? ? {
? ? ? ? "pagePath": "pages/index3/index3",
? ? ? ? "text": "我的",
? ? ? ? "iconPath": "/images/yuedu.png",
? ? ? ? "selectedIconPath": "/images/yuedu_hl.png"
? ? ? }
? ? ]
? }
}