I have 1 view ,now i click on it's subview
There are 2 conditions for that, 1> if subview is in portrait mode and then i switch it to landscape mode,at that time i wrote code and it works perfectly.
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(receivedRotate:) name: UIDeviceOrientationDidChangeNotification object: nil];
-(void) receivedRotate: (NSNotification*) notification
{
self.View.autoresizingMask = UIViewAutoresizingFlexibleWidth/UIViewAutoresizingFlexibleHeight;
}
but if i put my device initially in landscape mode and then click on subview then how to autoresizie subview
My que:- How to find out the method for the position of device? How to find my 开发者_StackOverflowdevice is in portrait or landscape mode?
you can check [[UIDevice currentDevice] orientation].
精彩评论