您只想知道如何添加一个瞬态对话框,说明已执行操作。
比如当用户点击保存并弹出保存并且窗口在不到一秒的时间内自动消失?
感谢提前
答案 0 :(得分:2)
使用如下的操作表:
/* present a dialog */
-(void)showDialog {
loadingActionSheet = [[UIActionSheet alloc] initWithTitle:@"Something was saved!" delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
[loadingActionSheet showInView:self.view];
[NSTimer scheduledTimerWithTimeInterval:1.5f target:self selector:@selector(closeActionSheet:) userInfo:nil repeats:NO];
}
/* close the actionsheet */
-(void)closeActionSheet:(id)sender {
[loadingActionSheet dismissWithClickedButtonIndex:0 animated:YES];
}
在标头中定义UIActionSheet *loadingActionSheet;
,并使用@property
& @synthesize
。
您还需要在标题中实施UIActionSheetDelegate
。