uniapp uses a custom navigation bar to overlap with the status bar that comes with the phone

[Question interface]:
insert image description here

[Normal interface]:
insert image description here

【Solution】:

  1. Add the code at the top of the page<!-- #ifndef H5 --> <statusBar></statusBar> <!-- #endif -->

insert image description here

2. Introduce placeholder and register

import statusBar from "@/uni_modules/uni-nav-bar/components/uni-nav-bar/uni-status-bar";
export default {
    
    
		components: {
    
    
			statusBar
		},
		...
	}

insert image description here

Guess you like

Origin blog.csdn.net/qq_43483403/article/details/131924154