iOS 7:在UIActionSheet委托函数中创build的UIAlertView不能自动旋转

这个问题只能在iOS 7中重现。

在委托函数中: - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex ,如果创build了UIAlertView,则警报视图不能自动旋转。 这里是示例代码:

 - (IBAction)buttonTapped:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"action sheet" delegate:self cancelButtonTitle:@"cancel" destructiveButtonTitle:@"ok" otherButtonTitles:nil]; [actionSheet showInView:self.view]; } - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:nil delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil]; [alert show]; } 

这是iOS 7的错误吗? 如果是的话,有什么办法让警报视图自动旋转与屏幕上的其他视图?

尝试从UIActionSheet的另一个委托方法展示alertview。 这工作:

 - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex 

这肯定看起来像iOS7中的错误:)