預設按鈕

實作
[xcode]
– (IBAction)openMethod:(id)sender {
UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"標題"
delegate:nil
cancelButtonTitle:@"取消"
destructiveButtonTitle:@"刪除"
otherButtonTitles:@"儲存", nil];
[action showInView:self.view];
}
[/xcode]

otherButton設計為五個按鈕

實作
[xcode]
– (IBAction)openMethod:(id)sender {
UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"標題"
delegate:nil
cancelButtonTitle:@"取消"
destructiveButtonTitle:@"刪除"
otherButtonTitles:@"儲存1", @"儲存2",@"儲存3",@"儲存4",@"儲存5",nil];
[action showInView:self.view];
}
[/xcode]

otherButton設計為六個按鈕

實作
[xcode]
– (IBAction)openMethod:(id)sender {
UIActionSheet *action = [[UIActionSheet alloc] initWithTitle:@"標題"
delegate:nil
cancelButtonTitle:@"取消"
destructiveButtonTitle:@"刪除"
otherButtonTitles:@"儲存1", @"儲存2",@"儲存3",@"儲存4",@"儲存5",@"儲存6",nil];
[action showInView:self.view];
}
[/xcode]

廣告