当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 移动安全加固助力 App 实现全面、有效的安全防护
- 【分享】接口测试如何在post请求中传递文件
- iOS中的内嵌汇编
- Android byte beat one side, was hanged by the interviewer! Fortunately, we got the offer from three sides
- 帮助企业摆脱困境,名企归乡工程师:能成功全靠有它!
- 什么是网站【新四化】?
- js字符与ASCII码互转的方法
- Rongyun has completed several hundred million RMB round D financing, and will continue to build global cloud communication capability
- CAD2020下载AutoCAD2020下载安装教程AutoCAD2020中文下载安装方法
- Get this template, double your salary
猜你喜欢

High quality defect analysis: let yourself write fewer bugs

实在是太棒了!阿里资深架构师20年经验整理分享ServiceMesh实战文档,涨薪就差这篇文章了!

高德全链路压测——语料智能化演进之路

Notes for csp-j / s 2020

How can you be a big data worker with an annual salary of 40W if you don't work hard?

5 minutes get I use GitHub's 5-year summary of these operations!

设置背景图片的两种方式,并解决手机端背景图片高度自适应问题

Chinese programmer vs Japanese programmer, full screen shame!

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

决策树算法-理论篇
随机推荐
程序员买房前后对比,看完后已哭瞎...
嘉宾专访|2020 PostgreSQL亚洲大会阿里云数据库专场:王健
Rongyun has completed several hundred million RMB round D financing, and will continue to build global cloud communication capability
Learning history of C language
布客·ApacheCN 编程/后端/大数据/人工智能学习资源 2020.11
基于Chef InSpec的基础设施测试
Do programmers pay too much to work overtime? Should programmer's salary be reduced? Netizen: let go of other hard pressed programmers
Hadoop学习(三)-YARN
MES system is different from traditional management in industry application
Arthas install quick installation document
arthas无网络环境下离线安装方法
iOS中的内嵌汇编
It's amazing! Ali senior architect 20 years of experience, collate and share servicemesh actual combat documents, pay rise is bad for this article!
毕业一年后接私活赚了10w,还拿了几家大厂offer!
International top journal radiology published the latest joint results of Huawei cloud, AI assisted detection of cerebral aneurysms
Application of EMQ X in the Internet of things platform of China Construction Bank
How to download and install autocad2020 in Chinese
为什么现在开发一款软件的时间越来越长?
高德全链路压测——语料智能化演进之路
干货推荐:关于网络安全技术的专业术语,你知道多少?