AutoresizingMask attribute of UIView, autoresizingmask
When I made the album list today, I found that some UITableViewController attributes were hard to remember and I found some materials. Make a backup.
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};
UIViewAutoresizingNone is not automatically adjusted, and the coordinate value of the control relative to the parent view remains unchanged.
UIViewAutoresizingFlexibleLeftMargin automatically adjusts the distance from the left side of superView to ensure that the distance from the right side of superView remains unchanged.
UIViewAutoresizingFlexibleRightMargin automatically adjusts the right distance from the superView to ensure that the left distance from the superView remains unchanged.
UIViewAutoresizingFlexibleTopMargin automatically adjusts the distance from the superView top to ensure that the distance from the superView bottom remains unchanged.
UIViewAutoresizingFlexibleBottomMargin automatically adjusts the distance from the superView bottom, that is, the distance from the superView top remains unchanged.
UIViewAutoresizingFlexibleWidth automatically adjusts its width to ensure that the distance from the left and right of the superView remains unchanged. The width of the control changes proportionally with the width of the parent view.
For example, the label width is 100 and the screen width is 320. When the screen width is 480, the label width changes to 100*480/320
UIViewAutoresizingFlexibleHeight automatically adjusts its height to ensure the distance from the top and bottom of the superView.
UIViewAutoresizingFlexibleLeftMargin.
For example: CGRectMake (50,100,200, 40)]; when the screen width is 320, x is 50;
When the screen width is 480, the labelx coordinate is changed to 50*480/320. Control coordinates change to CGRectMake (75,100,200, 40)];
The original distance is 68,102, and the adjusted distance is 68/20, that is, 102/30 =.
Other combinations are similar.
This article Reprinted from: http://www.cnblogs.com/jiangyazhou/archive/2012/06/26/2563041.html