I want x,y,widht,height values of view when it is autoresized automatically when orientation of ipad changes. How can i get that?
After the view has rotated you should be able to get the new dimensions of the view.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
CGRect myFrame = [self.view frame];
NSLog(@"height = %f", myFrame.size.height);
NSLog(@"width = %f", myFrame.size.width);
NSLog(@"x = %f", myFrame.origin.x);
NSLog(@"y = %f", myFrame.origin.y);
}
try this
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
float x = yourView.bounds.origin.x;
float y = yourView.bounds.origin.y;
float width = yourView.bounds.size.width;
float height = yourView.bounds.size.height;
NSLog(@"x=%f,y=%f,w=%f,h=%f",x,y,width,height);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With