Control screen size for live preview of monacaIDE using viewport

Asked 2 years ago, Updated 2 years ago, 75 views

We are developing with monacaIDE.

I want to automatically adjust the width of the screen for both iOS and Android.
Using this page, I am trying to control it with monaca.viewport as shown below.

Part of the Code

<script>
monaca.viewport({width:"device-width"});
</script>

However, in the live preview screen of monacaIDE, the width is the resolution of the PC screen and
The match will cause the display to shift.

If anyone has a good way to fix this problem, please let me know.

monaca

2022-09-30 18:18

1 Answers

First of all, the document you are referring to is old.
It does not work with the current Monaca.
(because the framework is Cordova5)
Please select a version from the pulldown in the upper right corner of the document to view it.

Past versions of the document are available in the
It is a reference material for those who have created previous versions.
Not for new developers.

Also, the preview screen displayed by Monaca IDE is
It is not necessarily the same as the actual screen.
Therefore, there is a high possibility that there will be a problem with the actual machine if the preview is supported.
As for the development environment, how about installing and confirming the debugger on the actual machine?


2022-09-30 18:18

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.