UIActionSheet和UIAlertView

来源:互联网 发布:疯狂英语李阳 知乎 编辑:程序博客网 时间:2024/05/17 07:07

UIActionSheet 是弹出一个事件选择框 

相关api:

实现UIActionSheetDelegate协议的- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex; 方法

根据不同的动作选项来处理事件,代码(arc) 如:

if (buttonIndex != actionSheet.cancelButtonIndex) {        UIAlertView *alert;        alert = [[UIAlertView alloc]initWithTitle:@"清空操作" message:@"清空用户名和密码" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];        [alert show];    }


UIAlertView 是一个对话框

代码:(arc)

 UIAlertView *alert;        alert = [[UIAlertView alloc]initWithTitle:@"清空操作" message:@"清空用户名和密码" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];        [alert show];


0 0
原创粉丝点击