加载中 ...
首页 > 新闻资讯 > 小程序 正文

小程序 development common problem solving skills

2019-07-13 01:06:15 来源:沈阳小程序开发 作者:沈阳软件开发

小程序开发What are the common problems? Many people who understand 小程序 have already earned the first pot of gold. And you are still waiting to see, do you want to learn 小程序 development, and more and more people who are engaged in the development of 小程序, then you have to start the pit, is it too late, when the company asked for your technology app development

ad.jpg

The level of skill is no longer at the junior engineer, but for those middle and senior developers who have been engaged in this field for many years. Today's shared articles, mainly share some 小程序 development needs to pay attention to the problem, the following 沈阳汇海 network listed some, there is a summary of the wrong place, welcome you to comment on the big cattle in the message.

6365957018939431409684790.jpg

1. The domain name must be HTTPS

Non-HTTPS domain names are not allowed by 微信小程序

2, input component placeholder font color

The color written in the placeholder-class does not take effect. It needs to be written in the placeholder-style.

3, wx.navigateTo can not jump to the page with tabbar

Pages with tabbars must be redirected using wx.switchTab

4. The page data cannot be refreshed when the tabbar is switched.

The tabbar implementation may be to show and hide the view, so the page.onLoad() method will not be called all the time. You can try to write the code logic in page.onShow()

5. How to get shareTickets

xx

获取shareTickets需要在app.onLaunch或app.onShow中获取,而不是page.onShow,请小心。

注意:建议在app.onShow中获取它,app.onLaunch并不总是执行

6,getPhoneNumber获取电话号码

目前,该界面对非个人开发者开放,并已完成认证小程序。个人开发人员无法调用此API

7,wx.previewImage图像预览

预览图像URL必须位于HTTPS的开头,而不是本地图像

8,wx.playVoice音频播放

您必须确保音频文件已经是本地文件,例如,在wx.startRecord之后,您可以获取filePath。或者在再次播放之前调用wx.downloadFile来下载资源文件

9,旧版API兼容

您可以使用wx.canIUse或wx.getSystemInfoSync来判断,旧版本给出了相应的提示

10.获取系统信息

wx.getSystemInfo,可以获取系统语言,屏幕宽度,微信版本号,操作系统,设备像素比,客户端库版本等信息

11,如何删除自定义按钮灰色圆角边框

主要元素是按钮的伪元素样式,可以删除:{display: none;}

后按钮:

12.返回页面顶部

回到页面顶部,有两种方法:

(1)使用滚动视图设置为垂直滚动,然后设置滚动顶部值;

(2)使用wx.pageScrollTo方法,1.4.0支持此方法,因此与低版本兼容;

13,输入textarea是APP的原始组件,z指数水平最高

完成搜索框的学生可能会遇到下面的IOS,在设置图标的z-index后,仍然无法显示。建议显示隐藏效果:点击前,它是一个视图,点击隐藏视图,显示输入〜

14,小程序有多冷汇海

小程序的机制是在退出后五分钟内进入。它会在退出前显示页面。如果要输入小程序,则相当于冷汇海的方式,并直接进入主页面。你可以在页面的onUnload中设置一个值,然后判断应用程序onShow上的值,然后决定是否跳转到主页〜

15.如何更改文本段落

小程序中唯一可以实现换行符的标记组件是文本

注意:不支持文本,仅使用\ n进行换行

16.设置最外层标签的边距底部在IOS下不起作用

在Android和开发工具中,保证金底部是正常的,它在IOS中不起作用,建议更改为padding-bottom

17, the canvas image in 小程序 does not support base64 format

The base64 format image can be displayed normally in the development tool, and is not displayed on the real machine. It is recommended to change to the url form with https at the beginning

xx

“沈阳软件公司”的新闻页面文章、图片、音频、视频等稿件均为自媒体人、第三方机构发布或转载。如稿件涉及版权等问题,请与

我们联系删除或处理,客服QQ:55506560,稿件内容仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同

其观点或证实其内容的真实性。