iphone - 在设备旋转之前关闭UIActionSheet?

标签 iphone ios uiactionsheet

在portaint Actionsheet中,在标签栏中显示。在风景中-在窗口中。我注意不要在旋转之前从选项卡中删除UIActionSheet,因为在wondow中旋转显示之后。
内部– willRotateToInterfaceOrientation:duration关闭操作表不起作用。

最佳答案

您可以为此使用NSNotification。在您的viewdidload文件中添加此通知程序,当方向更改时,您将收到通知:

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

…添加此方法:
-(void)OrientationChanged
{

}

参见NSNotification class reference

关于iphone - 在设备旋转之前关闭UIActionSheet?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3967554/

相关文章:

javascript - 如何在 iphone 的独立(全屏)模式下打开一个新窗口

ios - 如何检测 iOS 应用程序是否正在越狱手机上运行?

.net - MonoTouch 中是否缺少 NSDiacriticInsensitiveSearch 比较选项?

ios - 缓存下载的数据

iphone - 如何更改 UIWebView 点击事件

objective-c - UIActionSheet 只显示一次

iphone - uitableview 的 Storyboard错误

iphone - Apple 的 iOS 教程无法正常工作,我错过了什么?

ios - 如果应用程序在后台,UILocalNotification 如何调用某些方法

iOS 7 如何自定义按钮 UIActionSheet