网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

小程序項目的全局配置

發布時間:2021-06-08 08:32 所屬欄目:小程序開發教程

全局配置

window

用于設置小程序的狀態欄、導航條、標題、窗口背景色。

  • navigationBarBackgroundColor HexColor #000000 導航欄背景顏色,如 #000000

  • navigationBarTextStyle String white 導航欄標題顏色,僅支持 black / white

  • navigationBarTitleText String 導航欄標題文字內容

    wepy框架里面不能直接在app里面設置,需要在使用的頁面里面設置,否則不會顯示

  • navigationStyle String default 導航欄樣式,僅支持以下值:
    • default 默認樣式
    • custom 自定義導航欄,只保留右上角膠囊按鈕。
  • backgroundColor HexColor #ffffff 窗口的背景色

    當我們在微信小程序json中設置backgroundColor 時,實際在電腦的模擬器中根本看不到效果。
    這是因為 backgroundColor 指的窗體背景顏色,而不是頁面的背景顏色,即窗體下拉刷新或上拉加載時露出的背景。在電腦的模擬器中是看不到這個動作的,所以會讓人誤以為這個配置是無效的。

  • backgroundTextStyle String dark 下拉 loading 的樣式,僅支持 dark / light

  • backgroundColorTop String #ffffff 頂部窗口的背景色,僅 iOS 支持 微信客戶端 6.5.16

  • backgroundColorBottom String #ffffff 底部窗口的背景色,僅 iOS 支持 微信客戶端 6.5.16

  • enablePullDownRefresh Boolean false 是否開啟當前頁面的下拉刷新。
    詳見 Page.onPullDownRefresh

  • onReachBottomDistance Number 50 頁面上拉觸底事件觸發時距頁面底部距離,單位為px。
    詳見 Page.onReachBottom

  • pageOrientation String portrait 屏幕旋轉設置,僅支持 auto / portrait
    詳見 響應顯示區域變化 微信客戶端 6.7.3

用例:

window: {
    // 導航欄背景顏色
    "navigationBarBackgroundColor": "#FF6666",
    // 導航欄標題顏色,僅支持 black / white
    "navigationBarTextStyle": "white",
    // 航欄樣式,僅支持以下值: default, custom 自定義導航欄,只保留右上角膠囊按鈕
    "navigationStyle": "default",
    // 窗口的背景色
    "backgroundColor": "#e5e5e5",
    // 下拉 loading 的樣式,僅支持 dark / light
    "backgroundTextStyle": "dark",
    // 屏幕旋轉設置,僅支持 auto / portrait
    "pageOrientation": "portrait",
}

Tabbar

如果小程序是一個多tab應用(客戶端窗口的底部或頂部有 tab 欄可以切換頁面),可以通過tabBar配置項指定tab欄的表現,以及tab切換時顯示的對應頁面。

  • color tab上的文字默認顏色,僅支持十六進制顏色
  • selectedColor tab上的文字選中時的顏色,僅支持十六進制顏色
  • backgroundColor tab的背景色,僅支持十六進制顏色
  • borderStyle tabbar上邊框的顏色, 僅支持 black / white
  • list tab的列表,詳見 list 屬性說明,最少2個、最多5個 tab
  • position tabBar的位置,僅支持 bottom / top

list 接受一個數組,只能配置最少2個、最多5個 tab。tab 按數組的順序排序,每個項都是一個對象,其屬性值如下:

  • pagePath 頁面路徑,必須在 pages 中先定義
  • text tab上按鈕文字
  • iconPath 圖片路徑,icon 大小限制為40kb,建議尺寸為 81px * 81px,不支持網絡圖片。當 postion 為 top 時,不顯示 icon。
  • selectedIconPath 選中時的圖片路徑,icon 大小限制為40kb,建議尺寸為 81px * 81px,不支持網絡圖片。當 postion 為 top 時,不顯示 icon。

用例:

tabBar: {
    color: '#666666',
    selectedColor: '#ff6600',
    position: 'bottom',
    backgroundColor: '#fff',
    borderStyle: 'black',
    list: [
      {
        pagePath: 'pages/home/index',
        text: '首頁',
        iconPath: 'assets/img/icon-1.png',
        selectedIconPath: 'assets/img/icon-1-selected.png'
      },
      {
        pagePath: 'pages/search/index',
        text: '搜索',
        iconPath: 'assets/img/icon-2.png',
        selectedIconPath: 'assets/img/icon-2-selected.png'
      },
      {
        pagePath: 'pages/sell/index',
        text: '排行榜',
        iconPath: 'assets/img/icon-3.png',
        selectedIconPath: 'assets/img/icon-3-selected.png'
      },
      {
        pagePath: 'pages/spike/index',
        text: '搶購',
        iconPath: 'assets/img/icon-2.png',
        selectedIconPath: 'assets/img/icon-2-selected.png'
      },
      {
        pagePath: 'pages/profile/index',
        text: '我的',
        iconPath: 'assets/img/icon-5.png',
        selectedIconPath: 'assets/img/icon-5-selected.png'
      }
    ]
}


易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/26120.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×