Android Development does not display solutions correctly in response style

Source: Internet
Author: User

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 "

Related Article

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.