现在的位置: 首页 > 综合 > 正文

UIActionSheet

2013年04月23日 ⁄ 综合 ⁄ 共 645字 ⁄ 字号 评论关闭

UIActionSheet

(操作表)用于迫使用户在两个或更多选项之间进行选择都模式视图。操作表从屏幕底部弹出,显示一系列按钮供用户选择,用户只有单击了一个按钮后才能继续使用使用应用程序。

 

UsingViewsViewController.h

@interface UsingViewsViewController : UIViewController
<UIActionSheetDelegate>{

} 

 

 

 - (void)viewDidLoad {

    UIActionSheet *action = [[UIActionSheet alloc]
    initWithTitle:@”Title of Action Sheet”
    
delegate:self
    cancelButtonTitle:@”OK”
    destructiveButtonTitle:@”Delete Message”
    otherButtonTitles:@”Option 
1”, @”Option 2”,
    nil];
    [action showInView:self.view];
    [action release];
}

- (void)actionSheet:(UIActionSheet *)actionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex{
    NSLog(@”
%d”, buttonIndex);
}

 

 

 

 

 

 

抱歉!评论已关闭.