Iphone 在设备旋转前关闭UIActionSheet?

Iphone 在设备旋转前关闭UIActionSheet?,iphone,ios,uiactionsheet,Iphone,Ios,Uiactionsheet,在portaint操作表中,在选项卡栏中显示。在风景中-在窗口中。我注意到,在旋转之前,一定要从选项卡栏中删除UIActionSheet,因为旋转之后会在wondow中显示。 Inside–willRotateToInterfaceOrientation:duration Disclose action sheet不起作用。您可以使用NSNotification进行此操作。在viewdidload文件中添加此通知程序,当方向发生变化时,您将收到通知: [[NSNotificationCenter

在portaint操作表中,在选项卡栏中显示。在风景中-在窗口中。我注意到,在旋转之前,一定要从选项卡栏中删除UIActionSheet,因为旋转之后会在wondow中显示。
Inside–willRotateToInterfaceOrientation:duration Disclose action sheet不起作用。

您可以使用NSNotification进行此操作。在viewdidload文件中添加此通知程序,当方向发生变化时,您将收到通知:

[[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(OrientationChanged:) 
    name:@"UIDeviceOrientationDidChangeNotification"
    object:nil];
…添加此方法:

-(void)OrientationChanged
{

}

请参阅。

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

[[NSNotificationCenter defaultCenter] addObserver:self 
    selector:@selector(OrientationChanged:) 
    name:@"UIDeviceOrientationDidChangeNotification"
    object:nil];
…添加此方法:

-(void)OrientationChanged
{

}

请参见。

Me我在旋转前退出,然后在旋转后显示,然后在中间替换UIActionSheet

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    [APP.validSave dismissWithClickedButtonIndex:1 animated:NO];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    [APP.validSave showInView:APP.navController.view];
}

我在旋转前退出并在旋转后显示,然后在中间替换UIActionSheet

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
    [APP.validSave dismissWithClickedButtonIndex:1 animated:NO];
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    [APP.validSave showInView:APP.navController.view];
}