I had the same problem. But I have resolved it.
Yes, you can disable auto layout at runtime for a specific UIView
, instead of disabling it for the whole xib or storyboard which is set by default in Xcode 4.3 and later.
Set translatesAutoresizingMaskIntoConstraints
to YES
, before you set the frame of your subview:
self.exampleView.translatesAutoresizingMaskIntoConstraints = YES;
self.exampleView.frame = CGRectMake(20, 20, 50, 50);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…