当前位置:网站首页>Colleague notes - small program entry point
Colleague notes - small program entry point
2020-11-09 15:25:00 【The wind of fallen leaves】
1. Small program upload pictures or videos need to be compressed , There are limits to the procedure , The data is too laggy to show up
Three methods :
One is to use the official interface wx.compressImage(Object object);
One is by compressing the size of the image , utilize canvas Redraw to get a compressed image ;
Finally, install third-party image compression package .
2.textarea Component keyboard occlusion problem ,, Because it's a problem with native components , Model for this textarea The impact of components is huge , When focusing input, the keyboard blocks the input , Not scrolling up as expected , Compatible solutions can be cumbersome ,( When the focus is triggered, let it be textarea, It's to let it go for view) Encapsulates a textarea( The principle passes view Tag to replace the status when you don't click input )
3. Unit conversion :
BaseInfo.winWidth = res.windowWidth / (res.windowWidth / 750);
BaseInfo.winHeight = res.windowHeight / (res.windowWidth / 750);
1rpx = ( Device width / 750) px
1px=2rpx
1rem=35rpx
( Style compatibility is still troublesome , Early typesetting or need to be cautious )
The screen width of the applet is fixed to 750rpx( namely 750 Individual physical pixels ), It's true on all devices ,1rpx=(screenWidth / 750)px, among screenWidth Is the actual width of the phone screen ( Company px), for example iphone6 Of screenWidth=375px, It's in iphone6 in 1rpx=0.5px
4. Compatibility of various models , For Android and ios Compatibility is still troublesome , The front layout is still very important , It's better to consider the later compatibility in typesetting ,ipad And the style of mobile phone is also different , therefore px Still need to be precise
5.video Component problems , Applet video Component can't listen for events that are up and down
video Components api The document looks like this :
tip: video Component is a native component created by the client , Its hierarchy is the highest , Cannot pass z-index Control level
tip: Please do not leave scroll-view、swiper、picker-view、movable-view Use in video Components
tip: css Animation is right video Invalid component
Small program video You can't control the hierarchy problem
6.wxss It can't be used es6 Language
7.background-image Property only supports connection with network address , Local address has no effect
8.data assignment , stay js It can be used directly this.data, But it needs to be used in small programs setData To assign
9. When the development is complete, realize Really can't be in wxml There's too much writing in it style style , Because some of the lower versions of the hand are even incompatible
10. Try not to use margin-bottom , When the element is at the bottom of the page , stay ios Maybe margin-bottom It will fail , So suggest , All use padding-bottom
11.wx.navigateTo A new window opens the page The new page has a return button ,wx.redirectTo Close current page , Jump to a page in the app The new page has no return button
12.view Forced line wrap white-space:pre-wrap;
13. When the video is enlarged and played, there is no available method for wechat applet , You need to write your own mask , Over the screen , Click the mask to make a pop-up window to enlarge and play
14. Pictures don't need to be masked and pop-up windows , Wechat has its own available methods
15. Applet recording pause and natural playback end api The timer can't be turned off
Click pause : In the pause method Clear timer End of natural play : In the playback timer, judge that the playback time is equal to the recording time and turn off the timer
版权声明
本文为[The wind of fallen leaves]所创,转载请带上原文链接,感谢
边栏推荐
- To me, multithreading transaction must be a pseudo proposition!
- One year after graduation, I took private jobs to earn 10 W and got offers from several big factories!
- I interviewed a 33 year old Android programmer, who could only program for Baidu, but wanted 25K, which was met by me
- echart 设置柱子之间的间距
- 乘风破浪的技术大咖再次集结 | 腾讯云TVP持续航行中
- 【运维思考】如何做好云上运维服务?
- Autocad2020 full version installation text course, registration activation cracking method
- It's amazing! Ali senior architect 20 years of experience, collate and share servicemesh actual combat documents, pay rise is bad for this article!
- 一款基于.NET Core的认证授权解决方案-葫芦藤1.0开源啦
- The technology masters who ride the wind and waves gather again | Tencent cloud TVP continues to sail
猜你喜欢

AutoCAD2020 完整版安装图文教程、注册激活破解方法

同事笔记-小程序入坑点

5分钟GET我使用Github 5 年总结的这些骚操作!

A quick start to Shell Scripting

Using GaN based oversampling technique to improve the accuracy of model for mortality prediction of unbalanced covid-19

.NET报表生成器Stimulsoft Reports.Net 发布最新版v2020.5!

Programmers before and after buying a house, after reading has cried blind

决策树算法-理论篇

C language -- game of Sanzi

Cad2016 download autocad2016 download installation detailed tutorial CAD Download
随机推荐
AE(After Effects)的简单使用——记一次模板套用的过程
It's amazing! Ali senior architect 20 years of experience, collate and share servicemesh actual combat documents, pay rise is bad for this article!
布客·ApacheCN 编程/后端/大数据/人工智能学习资源 2020.11
To me, multithreading transaction must be a pseudo proposition!
5 minutes get I use GitHub's 5-year summary of these operations!
C语言—————三子棋游戏
I interviewed a 33 year old Android programmer, who could only program for Baidu, but wanted 25K, which was met by me
要我说,多线程事务它必须就是个伪命题!
谈谈敏捷开发概念和迭代开发方案
Application of EMQ X in the Internet of things platform of China Construction Bank
Decision tree algorithm theory
Using GaN based oversampling technique to improve the accuracy of model for mortality prediction of unbalanced covid-19
深入分析商淘多用户商城系统如何从搜索着手打造盈利点
C language (circular list) to achieve the basic function of snake
Method of conversion between JS character and ASCII code
【亲测有效】Github无法访问或者访问速度的解决方案
MES system is different from traditional management in industry application
Why I strongly recommend custom development of small programs, these benefits you need to understand
Two ways for Tencent cloud server to build WordPress website
「代码整洁之道-程序员的职业素养」读书笔记