当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Openyurt in depth interpretation: how to build kubernetes native cloud edge efficient collaborative network?
- 高德全链路压测——语料智能化演进之路
- High quality defect analysis: let yourself write fewer bugs
- shell脚本快速入门----shell基本语法总结
- C language -- game of Sanzi
- 微服务框架 Go-Micro 集成 Nacos 实战之服务注册与发现
- CAD2016下载AutoCAD2016下载安装详细教程CAD下载
- C language (circular list) to achieve the basic function of snake
- How to use Camtasia to make dynamic animation scene?
- Kubernetes v1.19.3 kubeadm deployment notes (2)
猜你喜欢
Kubernetes v1.19.3 kubeadm deployment notes (2)
MES system plays an important role in the factory production management
深入分析商淘多用户商城系统如何从搜索着手打造盈利点
Application of EMQ X in the Internet of things platform of China Construction Bank
如何使用Camtasia制作动态动画场景?
Get this template, double your salary
华为云GaussDB:从颠覆自我到颠覆行业,重构数据库市场新格局
python中常见的一些错误异常类型
靠“小抄”进字节:拿到这份模板,薪资能翻倍
你的钱为什么会被转走,这篇文章告诉你答案
随机推荐
How can you be a big data worker with an annual salary of 40W if you don't work hard?
AutoCAD2020 完整版安装图文教程、注册激活破解方法
A letter to myself
Rongyun has completed several hundred million RMB round D financing, and will continue to build global cloud communication capability
Lazy to write a document, swagger document does not smell
Explore cache configuration of Android gradle plug-in
使用art-Template模板获取天气预报信息
Echart sets the spacing between columns
C语言—————三子棋游戏
The way of a million year salary Architect: on the architecture design of application system
Programmers before and after buying a house, after reading has cried blind
echart 设置柱子之间的间距
Kubernetes v1.19.3 kubeadm deployment notes (2)
微服务框架 Go-Micro 集成 Nacos 实战之服务注册与发现
AUTOCAD2020安装包&安装教程
懒得写文档,swagger文档导出来不香吗
设置背景图片的两种方式,并解决手机端背景图片高度自适应问题
Kubernetes V1.19.3 kubeadm 部署笔记(中)
在Python中创建文字云或标签云
百万年薪架构师之路:谈应用系统架构设计