Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between rpx and px in Mini Program

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what is the difference between rpx and px in Mini programs," interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "What are the differences between rpx and px in Mini programs"!

Differences: 1, rpx is a relative length unit, and px is a fixed length unit;2, rpx can adapt to the mobile phone resolution, adapt to the current model, and px can not adapt to different resolutions of mobile phones.

Operating environment of this tutorial: HarmonyOS 2.0 system, WeChat version 8.0.19, HONOR V30.

Difference between rpx and px in Mini programs

In Mini programs, the size is generally px or rpx, where px is the pixel value in the traditional sense, which cannot be well adapted to mobile phones with different resolutions, so rpx appears

1. Rpx can adapt to mobile phone resolution and adapt to current models.

px is the absolute size.

rpx

rpx (responsive pixel): can be adapted to screen width. The specified screen width is 750rpx. For example, on the iPhone 6, the screen width is 375px, and there are 750 physical pixels in total, so 750rpx = 375px = 750 physical pixels, and 1rpx = 0.5px = 1 physical pixel.

Device rpx conversion px (screen width/750)px conversion rpx (750/screen width)iPhone51rpx = 0.42px1px = 2.34rpxiPhone61rpx = 0.5px1px = 2rpxiPhone6 Plus1rpx = 0.552px1px = 1.81rpx

Suggestion: Designers can use iPhone 6 as a visual standard when developing Weixin Mini Programs.

Note: On smaller screens there will inevitably be some glitches, please try to avoid this situation when developing.

At this point, I believe everyone has a deeper understanding of "what is the difference between rpx and px in Mini programs," so you might as well do it in practice! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report