How does Mini Program adapt to bangs?

to do H5 development, you need to adapt bangs. There is no bottom occlusion problem in Wechat development tool. Now Android also has a lot of bangs. How does Mini Program adapt to different bangs?


there are two cases:
1. If the navigationStyle value in app.json is default, there will be a default title bar of Wechat, and Wechat will do the adaptation work himself. Developers do not need to consider
2 and the navigationStyle value in app.json is custom,. Developers will handle the original title bar by themselves. You can get the statusBarHeight (height of the status bar) through wx.getSystemInfo to make the actual adaptation. Generally speaking, the height of the status bar includes the height of bangs

.

related documents:
https://developers.weixin.qq.
https://developers.weixin.qq.


Mini Program does not need to adapt to the bangs screen. It is based on Wechat, not APP


take iPhone X as an example. Bangs (top navigation bar) do not need to adapt. Mini Program's navigation bar adapts by default, and users can set navigationBar by passing page.json.
for the chin, using Mini Program's tab page, it will be adapted by default. In addition to the page, if there is an element whose fixed is located at the bottom, please obtain the device information through wx.getSystemInfo, and then judge its device through systemInfo.model . To put it simply, if you judge it to be iPhoneX, please dynamically set the element height to ensure that the element can have an ideal display effect under iphoneX.

Menu