Some problems encountered in applet development

小程序开发


浏览:837 次

Recently, I learned how to develop a small program and made a small program for real-time bus query. Some problems encountered during the process are recorded.

1. Vertical and horizontal center

display: flex;

justify-content: center; /* Horizontal Center*/

align-items: center; /* Center Vertically*/

Previously, the height and line height were specified as the same height for vertical centering. When the height was not specified, the above can be used

2. About rpx

At the beginning, I didn't read the official documents carefully. On the iPhone 8, 1px=2rpx, I naively thought that it was 1px=3rpx on the iPhone 8 Plus. As a result, a component display problem was found on a colleague's mobile phone a long time later