IPhone 4
IPhone 5
IPhone 6
IPhone 6 Plus
Display Size
3.5 in
4 in
4.7 in
5.5 In
Screen Size
x 480 Points
X 568 points
375 x 667 points
414 x 736 Points
Rendered Pixels
640 x 960 (@2x)
640 x 1136 (@2x)
X 1334
The concepts of PX, dip, SP, and DP are vague. I checked it online and found it clearly in theory.
1. PX (pixels): the point on the screen, which is related to the density. The density is high, and the PX size per unit area is large.
2. Dip or DP (pixels unrelated to density ). This is related to the hardware of th
/* big screen */@media (min-width:1200px) {...}/* Resolution between Tablet PC and small screen pc */@media (min-width:768px) and (max-width:979px) {...}/* Resolution between horizontally placed phones and vertically placed tablets */@media (max-width:767px) {...}/* Horizontally placed phones and devices with smaller resolution */@media (max-width:480px) {...}As
This question is not complex, but there are a lot of people asking, so I should concentrate on answering it.
Starting from Android 3.2 (API Level 13), use the following method in the activity to obtain the screen size (in pixels ):
Display display = getwindowmanager (). getdefaultdisplay ();//Activity # getwindowmanager ()Point
One, resolution Independent1. Using DP (DPI)Android uses density-independent pixels (DP) to specify the screen size, which allows zooming to achieve the same effect on devices with different pixel densities and the same screen size. (No problem with different
/** Obtain the window manager and default display, which we'll use to * find out the size of the Devi Ce ' s display (in pixels)*/WindowManager WindowManager=(WindowManager) Getsystemservice (Context.window_service); Display Display=Windowmanager.getdefaultdisplay (); /*Obtain the API level of the device running the game*/ intAPI =Android.os.Build.VERSION.SDK_INT; /** we ' re dealing with deprecated
: document.body.offsetHeight (including the width of the edge);Page body Full text width: document.body.scrollWidth;Page body Full text High: document.body.scrollHeight;The page was rolled High: document.body.scrollTop;The webpage is rolled away left: document.body.scrollLeft;Page body part: window.screentop;Page body part left: window.screenleft;High screen resolution: window.screen.height;Width of screen
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.