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

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.