开发者

UIView iPad orientation weirdness

W开发者_JAVA技巧hen I receive a UIDeviceOrientationDidChangeNotification how do I tell if it's a portrait/landscape change or a face up/face down change?

I also receive notifications in between landscape/portrait changes such as when the device goes 45 degrees between landscape & portrait. I only care about changes from full 90 landscape/portrait changes and would like to discard all other changes without doing anything.


If you're within a UIViewController, you can always ask for self.interfaceOrientation. It will have as value either UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight, UIInterfaceOrientationPortrait or UIInterfaceOrientationPortraitUpsideDown.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜