Flexible.js Mobile-compatible with Android high resolution incompatibility problem

Source: Internet
Author: User

According to the solution found on the Internet, for Android devices, change the dpr=1 to the current device DPR

if(!DPR &&!)Scale ) {        if(isiphone) {//iOS, for 2 and 3 screen, with twice times the scheme, the remaining 1 time times the scheme            if(Devicepixelratio >= 3 && (!DPR | | DPR >= 3) ) {DPR= 3; } Else if(Devicepixelratio >= 2 && (!DPR | | DPR >= 2) ) {DPR= 2; } Else{DPR= 1; }        } Else {            //Other devices, still using 1 time times the scheme            //DPR = 1;           //under Other devices, use the current DPR of the device insteadDPR =Devicepixelratio; } Scale= 1/DPR; }    

This time will not find some Android can be normal display, some Android display style is particularly small? In fact, there is a point to note that in the code, we may be different DPR devices set a different style, than the film, width, height, font size, and so on, it is necessary to consider the possible DPR Android, otherwise these specific styles will inevitably be in accordance with the default dpr=1 style to show. For example, the following is my default write Font-size

At present only a part of the Andro, no problem, dpr=2.75 is the millet mix,dpr=4 is Samsung S6 Edge, I see the online Android should also have dpr=1.5 situation, I have not met. So be sure to write a variety of programs, otherwise, the Android style really on the knees ................

Here is a piece of article written better, can recommend reading:http://blog.csdn.net/a0405221/article/details/78913714

In the course of testing also found a problem, vivo can't open our mobile website .......... Not for any other browser ...

Flexible.js Mobile-compatible with Android high resolution incompatibility

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.