How to get the frame size after autoresist

I wonder how and when (viewDidLoad, viewWillAppear, viewDidAppear) can I get the size of the UIViews frame that was authorized to fit its layout view?

+5
source share
4 answers

It is not clear from your question why you want this, but I assume that this is a layout of your approaches. Fortunately, Apple knew that you would want to do this and implemented -(void)layoutSubViewsit to see this: When is the Subviews layout called?

+1
source

layoutSubviews, , , , CGContext .

, , , init UIView, viewWillAppear.

, UIView, ( Google Apple docs SO).

0
- (void)viewDidAppear:(BOOL)animated {
    CGFloat uIViewWidth = self.uIView.bounds.size.width;
    CGFloat uIViewHeight = self.uIView.bounds.size.height;
    CGRect uIViewSize = CGRectMake(0, 0, uIViewWidth, uIViewHeight);
}
0
    NSLog(@"%f; %f; %f; %f;", yourView.frame.origin.x, yourView.frame.origin.y, yourView.frame.size.width, yourView.frame.size.height);

-6

All Articles