我正在尝试使用 UIAction 表来确认用户的操作。日志打印得很好......但应用程序挂起并在中间显示变亮的圆圈,就像您执行 UIAlert 视图时一样。我确定它很简单......但似乎找不到它。
-(IBAction)showActionSheet:(id)sender
{
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Reset Player" otherButtonTitles:nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
NSLog(@"Destructive Button Clicked");
}
else if (buttonIndex == 1) {
NSLog(@"Cancel Clicked");
}