Simple experience of mobile development with mui framework
Have you ever used mui to develop? This article mainly introduces the detailed explanation of the first experience of mobile development with the mui framework. The editor thinks it is quite good. I will share it with you now and give it as a reference. Let’s follow the editor to take a look, I hope it can help everyone.
1. Status bar settings
Now when most apps are opened, the status bar is integrated with the APP, which is not only beautiful, but also coordinated with the whole.
The blogger is a moderate obsessive-compulsive disorder patient, and the little black bar at the top really makes me uncomfortable.
First, we create a new mobile APP project on HBuilder
1.1 Immersive status bar (transparent status bar)
Generally, when the entire page is a picture, the status bar will be transparent.
First, detect whether the current environment supports the immersive status bar. Detection statement:
<script> document.addEventListener('plusready', function(){ //是否支持沉浸式状态栏 alert(plus.navigator.isImmersedStatusbar()); }); </script>
is not supported by default and false will pop up. If you want the environment to support it, you need to modify the configuration file manifest.json under the project
There is a manifest.json file under the project. After opening it, open the code view:
Add
"statusbar": { "immersed": true },
under the code view "plus" as shown in the picture:
- Android4.4 and above system support;
- iOS7 .0 and above systems support
<script> document.addEventListener('plusready', function(){ //参数:true - 全屏;false - 不全屏 plus.navigator.setFullscreen(true); }); </script>The effect is as follows:
##1.3 Status bar background color
Modifying the background color is generally used in scenarios where the background color at the top of the page is a solid color. Modify it to the same background color as the page to make the page more harmonious.
//设置系统状态栏背景色 plus.navigator.setStatusBarBackground('#6495ED');
The Android platform does not support this function. If there is an expert, please give me some advice.
2. Frosted glass effect
Blurring pictures can give people a hazy and beautiful effect. Click on the image blur effect not mentioned before:
css attribute filter:
filter: blur(16px);
The pixels in blur() are the degree of blur.
3. Simply use mui to quickly build a page
The status bar problem that bothered me most has been solved, and the page layout is easier to handle. It can be built quickly using mui templates.
Take XX Music as an example:
2.1 Import file
<script></script> <link> <link>
2.2HTML code
The following HTML code is the mui framework part used and the above status bar The relevant part, this mui is about the regional carousel part
The top img is the background image, the p wrapped in the outer layer is very necessary, and the overflow attribute must be used flexibly to achieve perfect effects.
Because the header part of the APP uses positioning, the main part of the page needs to add a padding-top with a height of about 74px
<p> </p><p> </p><p> 第一个轮播区域 </p> <p> </p><p> <span></span> <span>G-DRAGON</span> <span></span> </p> <p> <img src="/static/imghwm/default1.png" data-src="img/player_btn_sq_hlight.png" class="lazy" alt="Simple experience of mobile development with mui framework" > <img src="/static/imghwm/default1.png" data-src="img/player_btn_mv_normal.png" class="lazy" alt="Simple experience of mobile development with mui framework" > <img src="/static/imghwm/default1.png" data-src="img/player_btn_dts_on.png" class="lazy" alt="Simple experience of mobile development with mui framework" > </p> <p> <img src="/static/imghwm/default1.png" data-src="img/GD.jpg" class="lazy" alt="Simple experience of mobile development with mui framework" > </p> <p>A Boy - G-DRAGON</p> <p> 第二个轮播区域 </p> <p> </p><p></p> <p></p> <p></p>
Main css code:
*{ padding: 0px; margin: 0px; } body{ overflow: hidden; height: 100vh; } #background{ overflow: hidden; text-align: right; } #background #backImg{ margin-left: -120px; height: 99vh; filter: blur(16px); } .mui-bar-nav{ top: 30px; background-color: rgba(0,0,0,0); box-shadow: 0 0px 0px #ccc; } .mui-bar-nav .mui-title{ color: white; font-size: 20px; font-weight: normal; line-height: 50px; } #continer{ width: 100%; height: 100vh; position: relative; top: -100vh; z-index: 5; padding-top: 80px; background-color: rgba(0,0,0,0.7); text-align: center; color: white; }
The latter is different I didn’t think of center-aligning the large and small pictures for a moment. Here we need to use the cross-axis alignment of flexible layout:
#continer .footer1{ margin-bottom: 0px; display: flex; align-items: center; justify-content: center; }
Show the effect below:
小q It is said that
bloggers also want to improve themselves when writing blogs, and they also ask for advice from experts.
In addition, the framework is indeed easy to use, but the blogger feels that you still have to master the native code first.
Related recommendations:
How to use the MUI framework in mobile HTML5Mui uses jquery and uses click to jump to a new window example sharing Example details the encapsulation process of mui pull-up to load more pull-down refresh dataThe above is the detailed content of Simple experience of mobile development with mui framework. For more information, please follow other related articles on the PHP Chinese website!

JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

Node.js excels at efficient I/O, largely thanks to streams. Streams process data incrementally, avoiding memory overload—ideal for large files, network tasks, and real-time applications. Combining streams with TypeScript's type safety creates a powe

The differences in performance and efficiency between Python and JavaScript are mainly reflected in: 1) As an interpreted language, Python runs slowly but has high development efficiency and is suitable for rapid prototype development; 2) JavaScript is limited to single thread in the browser, but multi-threading and asynchronous I/O can be used to improve performance in Node.js, and both have advantages in actual projects.

JavaScript originated in 1995 and was created by Brandon Ike, and realized the language into C. 1.C language provides high performance and system-level programming capabilities for JavaScript. 2. JavaScript's memory management and performance optimization rely on C language. 3. The cross-platform feature of C language helps JavaScript run efficiently on different operating systems.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version
God-level code editing software (SublimeText3)

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
