Home> Web Front-end> uni-app> body text

Hide the top navigation bar on the uniapp homepage

PHPz
Release: 2023-04-20 15:01:25
Original
103 people have browsed it

In mobile application development, it is often necessary to hide certain elements on the page. For example, in uniapp, hiding the top navigation bar on the homepage is a common requirement. This article will introduce how to use the API provided by uniapp to implement this function.

In uniapp, the basic structure of all pages is as follows:

 
Copy after login

Among them, thetag is used to wrap the content of the page, If you want to hide the top navigation bar, just add a special attributenavigation-bar-fixedon thetag. Specifically, change thetag to the following form:

  
Copy after login

In this way, the top navigation bar in the page will be hidden. It is important to note that sincenavigation-bar-fixedis a custom attribute, it must be defined in the style of the page, otherwise the navigation bar will not be hidden. The style is defined as follows:

Copy after login

It should be noted that theapp-uni-status-bar,app-uni-nav-barandpage-bodyrespectively represent the top status bar, navigation bar and page content area that comes with the system. They need to be hidden at the same time to achieve a complete navigation bar hiding effect.

To sum up, by adding custom attributes and modifying the page style, we can easily implement the function of hiding the top navigation bar in uniapp.

The above is the detailed content of Hide the top navigation bar on the uniapp homepage. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!