作者:朱克锋
邮箱:zhukefeng@iboxpay.com
转载请注明出处:http://blog.csdn.net/linux_zkf
实例截图
这种简单的警告菜单效果是从底部慢慢的推出,有明显的动画效果,用到了操作表的代理方法(与菜单警告实现一样)
1,操作表的代理方法
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
[actionSheet release];
[self say:@"You Pressed Button %d\n", buttonIndex + 1];
}
2,触发
-(void) action: (UIBarButtonItem *) item
{
UIActionSheet *menu = [[UIActionSheet alloc]
initWithTitle: @"TEST ALERT"
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"A", @"B", @"C", @"D", @"E", @"Six", @"F",
@"G", @"H", @"I", @"J", @"K", @"L", nil];
[menu showInView:self.view];
}