开发者

how to find position of iphone

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].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜