首页 > 代码库 > IOS autosizing(设置控件的固定位置大小)

IOS autosizing(设置控件的固定位置大小)

 

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    /*
     UIViewAutoresizingNone                 = 0,  什么都没有设置
     UIViewAutoresizingFlexibleLeftMargin   = 1 << 0, // 代表距离左边的距离是不确定的, 也就是说距离右边的距离是固定
     UIViewAutoresizingFlexibleWidth        = 1 << 1,
     UIViewAutoresizingFlexibleRightMargin  = 1 << 2, // 代表距离右边的距离是不确定的, 也就是说距离左边的距离是固定
     UIViewAutoresizingFlexibleTopMargin    = 1 << 3,
     UIViewAutoresizingFlexibleHeight       = 1 << 4,
     UIViewAutoresizingFlexibleBottomMargin = 1 << 5
     */
    self.view.autoresizingMask =  UIViewAutoresizingFlexibleRightMargin;
}

 

IOS autosizing(设置控件的固定位置大小)