About multiline text textarea on iOS true computer padding relative to Android larger issue

Source: Internet
Author: User

Problem:

The multiline text component is padding with the default, however, the teatarea of the applet is different on iOS and Android, and the padding of universal iOS is significantly larger than that of Android. In this case my idea is to do compatibility, that is, to deal with it separately.

In the official document of the applet there is a way to know the current use of the model of the applet, namely Wx.getsysteminfosync (), the Official document link is: https://mp.weixin.qq.com/debug/wxadoc/dev/api/ Systeminfo.html#wxgetsysteminfosync

The idea is to first get the current model content, and then set the value to display the properties on the page, the code is as follows:

1<textarea placeholder= "Input Information" style= "Padding:{{detail? ' 10rpx; ': ' 20rpx; '}} ' />2 //display different attribute values according to the value of detail3 4 5 Page ({6 data: {7Detailfalse  //The default display for Android8    },9OnLoad:function(e) {Ten        varPhone=wx.getsysteminfosync ();//call method Get model One        vardetail; A     if(phone.platform== ' iOS '){ -Detail=true; -}Else if(Phone.platform = = ' Android '){ theDetail =false; -     } -   }     -})

The available model contents are as follows, Devtools shown in the simulator, on the real machine are iOS and Android:

Summary: The above content for learning summary sharing, there is nothing wrong place or can optimize the place, welcome you many advice.

About multiline text textarea on iOS true computer padding relative to Android larger issue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.