一、官方文檔https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/page.html -----頁面配置中
avigationStyle 導航欄樣式,僅支持 default/custom。custom 模式可自定義導航欄,只保留右上角膠囊狀的按鈕)。
在app.json window 增加 navigationStyle:custom ,頂部導航欄就會消失,保留右上角膠囊狀的按鈕,
1.如何兼容適配所有機型,包括劉海屏?
A:使用 wx.getSystemInfoSync()['statusBarHeight'] 則能獲取到頂部狀態欄的高度,單位爲px.