iphone - device Orientation 到 statusBar Orientation 改变

标签 iphone ios uideviceorientation nsstatusbar

我已经创建了一个设备方向监听器来捕捉设备旋转的时间,就像这样

[[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(jumpBarButtonPosition)
                                                 name:@"UIDeviceOrientationDidChangeNotification" object:nil];

但是在 jumpBarButtonPosition 方法中,我已经从使用 UIDeviceOrientation 更改为 statusBarOrientation,所以我想知道我可以用什么替换 UIDeviceOrientationDidChangeNotification 以便只接收有关 statudBarOrientation 更改的通知。

最佳答案

不要将其作为字符串键入:@"UIDeviceOrientationDidChangeNotification"使用:

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(jumpBarButtonPosition)
                                             name:UIDeviceOrientationDidChangeNotification object:nil];

关于iphone - device Orientation 到 statusBar Orientation 改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11091521/

相关文章:

iphone - 对齐 UIButton 的文本?

iphone - 如何在 iPhone/iPad 中自动调用崩溃的应用程序

ios - Interface Builder 中的 Text Styles 是什么?

ios - 将文本设置为 uitextview 应用程序崩溃 - ios sdk

iphone - Xcode 3.2.6 适合运行 iOS 5 beta 6 的 iPhone 吗?

ios - UIBarButtonItem(自定义 View :) -- not tappable

android - 如何使用 Adob​​e air - AS3 在静音模式下检测设备并与之交互

objective-c - 只能获取之前的轮换

objective-c - 如何在控制设备方向的同时控制设备状态栏的方向?

iphone - 处理 ios 设备方向