我试图通知我的UIViewController
按设备方向重新应用布局。为此,我将UIDeviceOrientationDidChangeNotification
发布到默认中心。它的工作,但没有旋转动画。我认为我有些失踪。我如何正确地发帖UIDeviceOrientationDidChangeNotification
?如何正确发布`UIDeviceOrientationDidChangeNotification`?
1
A
回答
0
我不认为应该有任何东西,当你尝试发布。 取而代之的是,当方向改变时它会自动发布。如果你想使用它,你应该添加一个观察者帽子通知。
1
用途:
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:YES];
代替(替换LandscapeRight需要的话),因为你不应该发布的系统通知。
1
它将发布的事件对你:
- (void)updateOrientation
{
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
}
但是,当然,你应该更整洁,并呼吁[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]
当你需要停止旋转,然后调用[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
当你准备好来处理它再次:它会调用您的视图控制器的所有必要的回调。
相关问题
- 1. UIDeviceOrientationDidChangeNotification不会触发?
- 2. NSMutableURLRequest正确发布
- 3. cURL如何正确发布此表单?
- 4. 如何正确发布活动?
- 5. 如何使用extern正确发布项目数据正确
- 6. UIDeviceOrientationDidChangeNotification只会触发一次
- 7. UIImagePickerController的正确发布
- 8. Ajax.BeginForm发布不正确
- 9. HttpPost未正确发布
- 10. 由UIDeviceOrientationDidChangeNotification返回的不正确的设备方向
- 11. 如何正确触发`fireTableDataChanged`
- 12. 试图了解如何shouldAutorotateToInterfaceOrientation和UIDeviceOrientationDidChangeNotification
- 13. 的Facebook上发布后iPhone API:不发布正确
- 14. 如何正确发布到php web服务使用JSON和C#
- 15. 如何正确实现发布和订阅流星js
- 16. jQuery可排序:如何正确发布元素ID数组?
- 17. Django开发 - 如何正确布局和使用代码
- 18. 如何在PowerShell中正确使用发布请求
- 19. 如何演示未正确发布的值的竞争条件?
- 20. 正确的Web.Config发布WebMethod AJAX
- 21. 流星未发布正确的用户
- 22. 发布JSON的正确方法Formdata
- 23. WCF发布是正确的选择吗?
- 24. 内容未被正确发布?
- 25. YouTube API未发布评论正确
- 26. 正确获取CURL发布参数(PHP)
- 27. 正确地发布到此API
- 28. 发布对象正确返回?
- 29. 贝宝变量没有正确发布
- 30. 何时正确使用@ property/@ synthesis,(id)发件人和发布版
我试图模拟UI的方向变化... – Eonil 2011-03-21 02:12:09