1.30 Summary

Source: Internet
Author: User

One: Three steps to become a single case

1, import the third party framework #import "Singleton.h" in h file;

2, write in H file: #define Singleton_interface (ClassName)

3. Write in M file: #define Singleton_implementation (ClassName)

Second, how to make the view not appear from the bottom of the navigation bar

1, judging

#define IOS7 ([[Uidevice currentdevice].systemversion Doublevalue] >= 7.0)

2. Use: if (iOS7) {

Self.edgesforextendedlayout=uirectedgenone;

}

Third, how to achieve automatic scaling?

For iphone projects, there is generally no need for a screen fit, but for ipad projects it is generally necessary to adapt to the screen. The specific implementation is:

Uiviewautoresizingnone is not automatically adjusted.

Uiviewautoresizingflexibleleftmargin automatically adjusts the distance to the left of the superview, ensuring that the distance to the right of the Superview is constant.

Uiviewautoresizingflexiblerightmargin automatically adjusts to the right distance from the Superview to ensure that the distance to the left of the Superview is constant.

The uiviewautoresizingflexibletopmargin automatically adjusts the distance from the top of the Superview to ensure that the distance from the bottom of the Superview is constant.

Uiviewautoresizingflexiblebottommargin automatically adjusts the distance from the bottom of the Superview, that is, the distance from the top of the Superview is constant.

Uiviewautoresizingflexiblewidth automatically adjusts its width to ensure that the distance to the left and right of the Superview is constant.

Uiviewautoresizingflexibleheight automatically adjusts its height to ensure that the distance from the top and bottom of the Superview is constant.

1.30 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.