2019-01-30更新
1.關(guān)于自定義頂部導航欄Android/IOS高度不一致的問題
效果
小程序可以實現(xiàn)自定義頂部導航欄,在app.json中設(shè)置
{
"window": {
"navigationStyle": "custom"
}
}
開啟之后頁面會頂?shù)狡聊蛔钌隙?,需要自行完成布?/p>
推薦一個自己寫的小demo Indomi/wxNavbar
但是在Android/IOS中,導航欄的高度是不一致的,在IOS中,通過wx.getSystemInfo獲得的系統(tǒng)信息可以得到

IOS
導航欄高度 = screenHeight - statusBarHeight - windowHeight = 44
在安卓端

Android
導航欄高度 = screenHeight - statusBarHeight - windowHeight = 48
不知道是不是系統(tǒng)層面設(shè)計風格不同的原因,在實際開發(fā)中使用的是以48為準
額外的tips:
大部分手機的statusBarHeight為20,但是iphoneX的statusBarHeight為44
個人博客:Indomi