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