Detailed description of the autoresizingMask attribute of UIView.

Source: Internet
Author: User

Reposted from: liubo0_0 column link URL: http://blog.csdn.net/liubo0_0/article/details/7085935

In UIView, there is an autoresizingMask attribute, which corresponds to an enumerated value (as follows). The attribute means to automatically adjust the position between the child control and the parent control, with a width and height.

Enum {
UIViewAutoresizingNone = 0,
UIViewAutoresizingFlexibleLeftMargin = 1 <0,
UIViewAutoresizingFlexibleWidth = 1 <1,
UIViewAutoresizingFlexibleRightMargin = 1 <2,
UIViewAutoresizingFlexibleTopMargin = 1 <3,
UIViewAutoresizingFlexibleHeight = 1 <4,
UIViewAutoresizingFlexibleBottomMargin = 1 <5
};
Typedef NSUInteger UIViewAutoresizing;

 

The above meanings are explained separately.

UIViewAutoresizingNone is not automatically adjusted.

UIViewAutoresizingFlexibleLeftMargin is used to automatically adjust the distance from the left side of the superView, that is, the distance from the right side of the superView remains unchanged.

UIViewAutoresizingFlexibleRightMargin automatically adjusts the right distance from the superView, that is, the distance from the left side of the superView remains unchanged.

UIViewAutoresizingFlexibleTopMargin

UIViewAutoresizingFlexibleBottomMargin

UIViewAutoresizingFlexibleWidth

UIViewAutoresizingFlexibleHeight

The above will not be explained. Refer to the above.

You can also set multiple enumerations at the same time. As follows:

SubView. autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;

If there are multiple, associate them with "|.

Another attribute is autoresizesSubviews. This attribute indicates whether subviews can be automatically adjusted. The default status is YES, which means YES. If it is set to NO, the autoresizingMask attribute of the subView is invalid.

Related Article

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.