Today, time to write a ~ before already done two demo, mainly using css+html completed, today or to complete a demo, build a pet website. Before we start, we'll introduce a knowledge point about adaptation.
In fact, for the front end of learning, H5 mobile phone fitness is also a cliché of the problem, of course, there are Daniel on the net to the solution, here I will combine their actual situation analysis of this adaptation problem.
Foundation:
1.viewport
This is added between
With the popularization of 3G, more and more people use mobile Internet.Mobile devices are exceeding desktop devices and becoming the most common endpoint for accessing the Internet. As a result, web designers have to face a dilemma: how can the same page be presented on devices of different sizes?The screen of the phone is smaller and generally 600 pixels wide, and the screen width of the PC is generally a
According to the screen size and resolution, IOS currently has six versions.1, 3gs; 2, 4S: Representative; 3, iphone5; 4, ipad2: Representative; 5, ipad4: Representative; 6, iPad Mini.Only when the resolution is different, such as the first, second, or fourth, the development can provide two kinds of resolution, automatically recognized by the application?It's just the case that the sizes are different. For
One, the smartphone operating system, browser, screen size
NetMarketShare Data Site September 2015 smartphone operating system market share rankings. Android platform mobile phone, iOS platform iphone, BlackBerry (BlackBerry), the respective built-in Web browser, as follows:
Android Browser in Android
Mobile Safari in iOS
According to the screen size and resolution, ios currently has six versions.
The existing resolutions of iOS devices are as follows:IPhone/iPod TouchIPhone 1, 3G, 3 GS, iPod Touch 1, 2, and 3Retina screen 640 pixels x 960 pixels iPhone 4, 4 S, iPod Touch 4Retina screen 640 p
The traditional font size adaptation may fit according to the width of the screen with a ratio of iphone5 or iphone6 width. But if there is a need to display a font on the phone that displays the @2x picture, another fixed-size font appears on the phone that displays the @3x picture.So the point here is to distinguish between the
Mobile phone station development encountered some problems, design page Use how large size? To do some research, in addition to the iphone special some, currently on the market Android system actually display the width of the page, are 360px.
Mobile phone model
Vertical screen width
IPhone
IOS app icon and splash screen sizeThe author briefly focuses on Note: The rounded effect of all iOS icons is generated by the system, and the icons given cannot be rounded.1. Desktop icon (app icon)
For IPhone6 Plus (@3x): 180 x
For IPhone 6/5S/5/4S/4 (@2x): x 120
2. System search box icon (Spotlight Search results icon)
For IPhone6 Plus (@3x): x 120
For IPHONE6/5S/5/4S/4 (@
IOS app icon and splash screen sizeNote: The rounded effect of all iOS icons is generated by the system, and the icons given cannot be rounded.1. Desktop icon (app icon)
For IPhone6 Plus (@3x): 180 x
For IPhone 6/5S/5/4S/4 (@2x): x 120
2. System search box icon (Spotlight Search results icon)
For IPhone6 Plus (@3x): x 120
For IPHONE6/5S/5/4S/4 (@2x): x 80
3. System settin
Get screen Size[[[UIScreen mainScreen] currentMode].size.width];[[[UIScreen mainScreen] currentMode].size.height];也能够:NSLog (@ "Frame height:%f frame width:%f", self.frame.size.height,self.frame.size.width);As the above code on different devices, the resulting values are different.
IPhone (3.5 inch): x 480 -- Iphone3
IPhone Devices:IPhone 1G---320x480IPhone 3G---320x480IPhone 3GS---320x480IPhone 4---640x960IPhone 4S---640x960IPhone 5---640x1136IPhone 5S---640x1136IPhone 5C---640x1136IPhone 6---750x1334IPhone 6 Plus---1080x1920 (development should be adapted according to 1242x2208)IPhone 6S---750x1334IPhone 6S Plus---1080x1920 (development should be adapted according to 1242x2208)IPh
Note: The rounded effect of all iOS icons is generated by the system, and the icons given cannot be rounded.1. Desktop icon (app icon)
For IPhone6 Plus (@3x): 180 x
For IPhone 6/5S/5/4S/4 (@2x): x 120
2. System search box icon (Spotlight Search results icon)
For IPhone6 Plus (@3x): x 120
For IPHONE6/5S/5/4S/4 (@2x): x 80
3. System settings icon (Settings icon)
For IPhone6 Plus (@3x): x 87
For IPHONE6/5S
1. Desktop icon (app icon)
For IPhone6 Plus (@3x): 180 x
For IPhone 6/5S/5/4S/4 (@2x): x 120
2. System search box icon (Spotlight Search results icon)
For IPhone6 Plus (@3x): x 120
For IPHONE6/5S/5/4S/4 (@2x): x 80
3. System settings icon (Settings icon)
For IPhone6 Plus (@3x): x 87
For IPHONE6/5S/5/4S/4 (@2x): x 58
4. Boot image (launch image)
For IPHOEN5S/5 (@2x): 640 x 1136
For IPHO
When using Cocos2d-iphone 2.0 to build the project, the 5s test when the full screen up and down always have black bar, found [[UIScreen mainscreen] bounds] returned the screen size is not 320*568, but 320*480. Later in the project warning found the hint missing [email protected]:Click and then eject:Click Add and then
/M_obDesignResolutionSize.width;
M_fScaleY = (float) m_obScreenSize.height/M_obDesignResolutionSize.height;
This is the key code. The Code regards the 1 or 2 parameters passed in as the width and height of the design size, and then calculates the ratio with the width and height of the screenSize to determine the scaling ratio.
Where is the screenSize source? two functions are displayed.
Const CCSize CCEGLViewProtocol: getFrameSize () const
{
ReturnM
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.