Mobile Front End Development summary

Source: Internet
Author: User

Mobile front-end development, that is, WebApp, mainly for the iphone, Android and other high-end mobile phones.

1, Prohibit user screen rotation.

This can be sure to do not, before because there are items need to prohibit screen rotation, so online access to a large number of data, found there is no solution, in the mobile version of WebKit can not do. The Apple API also shows that, in order for users to navigate the Web in Safari, we have to ensure that the user's device is in any One direction, and Safari is able to display the content of the Web page (ie, adaptive) in a normal So we prohibit the developer from blocking the browser's Orientationchange event, so iOS is forbidden to block the Orientationchange event, and Android is the same, and can not prevent screen rotation, so in the webapp is not done. However, the Orientationchange event can be used to determine the direction, the horizontal screen display mode and vertical screen display mode, written in two styles.

2. Private meta tag of WebKit kernel

  1. <meta Content="width=device-width; initial-scale=1.0; maximum-scale=1.0; User-scalable=0 " name=" viewport " />
  2. <meta Content="Black" name="Apple-mobile-web-app-status-bar-style" / >
  3. <meta Content="yes" name="apple-mobile-web-app-capable" / >
  4. <meta Content="Telephone=no" name="format-detection" />

(1), the main I is to force the width of the document and the device to maintain a width of 1:1, the maximum width of 1.0, prohibit screen scaling.

(2), the iphone's private label, the iphone top status bar style.

(3), this is also the iphone private label, allowing full screen browsing.

(4), prohibit the number automatically recognized as the phone number, this is more useful, because a string of numbers on the iphone will be shown in blue, style added to other colors is not effective.

3. Remove Android Auto-recognition email address

Android has an automatic mailbox recognition feature, but Apple doesn't. To remove the mailbox recognition feature, add a meta tag to the head.

    1. <meta Content="Email=no" name="format-detection" />

4. Remove the URL address bar for Android and iOS

    1. SetTimeout(scrollTo,0,0,0);

Put this sentence in the window.onload.

(Reference: Web Front end http://www.linzenews.com/program/web/2773.html)

Mobile front end Development summary

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.