call use the follow method to do .
Observe
UIDeviceOrientationDidChangeNotification:[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationDidChange:) name:UIDeviceOrientationDidChangeNotification object:nil]; ... - (void)orientationDidChange:(NSNotification *)note { NSLog(@"new orientation = %d", [[UIDevice currentDevice] orientation]); }
willRotateToInterfaceOrientation not called
观察设备方向变化方法
最新推荐文章于 2022-05-12 19:16:16 发布
本文介绍了如何使用Objective-C监听并获取设备的方向变化,通过订阅通知和解析设备旋转事件来实现设备方向的实时监控。
2278

被折叠的 条评论
为什么被折叠?



