Note the recent development of mobile hybrid applications, a problem encountered: Android cannot be displayed correctly according to the specified response style.
First of all, two times you've encountered this problem:
1. When using the jquery Mobile Write interface, the font and interface on the test machine (G7) are smaller.
2. There is no problem with the layout of the custom response style on the G7, and the interface appears normal. But on the Millet 2S, the interface shows an error. Through the JS script to get a bit of millet 2S screen width, found that the value is not imagined 720px, but 360px, so the response style will occur incorrectly.
When the target-densitydpi is not set
Get the correct response layout when setting target-densitydpi
Originally on Android, it would be target-densitydpi to get the DPI. In the case of not setting, the default selection is medium-dpi (160).
The above two questions can be solved by adding the META tag to target-densitydpi=device-dpi
the code as follows.
code is as follows |
copy code |
<meta Name= "Viewport" content= "target-densitydpi=device-dpi, Width=device-width, initial-scale=1, User-scalable=no, minimum-scale=1.0, maximum-scale=1.0 " |