0

以下に示すような削除確認を作成するにはどうすればよいですか?

4

4 に答える 4

2

UIActionSheetを使用する必要があります。

このようなアクションシートを作成できます

UIActionSheet *actionSheet = [[UIActionSheet alloc] 
                                initWithTitle:@”YOUR_ACTION_SHEET_TITLE” 
                                delegate:self 
                                cancelButtonTitle:@”Cancel” 
                                destructiveButtonTitle:@”Erase Iphone” 
                                otherButtonTitles:nil];
[actionSheet showInView:self.view];
[actionSheet release];//If you are not using ARC

UIActionSheetDelegateメソッドを実装する必要があります

- (void)actionSheet:(UIActionSheet *)actionSheet 
            clickedButtonAtIndex:(NSInteger)buttonIndex{

    if (buttonIndex == 0){
       //do your action
    }else if(buttonIndex == 1){
      // do your other action
    }
}
于 2011-04-29T06:36:39.597 に答える
2

これはUIActionSheetのインスタンスです。赤いボタンは「破壊ボタン」と呼ばれ、黒いボタンは「キャンセルボタン」と呼ばれます。

これがデモです:

UIActionSheet *actSheet = [[UIActionSheet alloc] initWithTitle:@"The text to show on top. (Like the message about wiping the phone.)"delegate:nil cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete everything" otherButtonTitles:nil];
[actSheet ShowFromToolbar:self.toolbar];
[actSheet release];
于 2011-04-29T06:36:46.150 に答える
1

他のボタンと一緒に写真に示されているものと同じものが必要な場合は、以下のUIActionSheetブログチュートリアルを使用し、スタンドアロンボタンのみが必要な場合は、以下のSO投稿に従ってください。

iPhone SDKを使用して大きな赤いUIButtonを作成するにはどうすればよいですか?

于 2011-04-29T06:36:22.503 に答える
0

InterfaceBuilder(またはxCode4の同等のエディター)を使用してビューを作成します。ビューコントローラを作成します。次に、Core Animationを使用して、ビューをアニメーション化して下からスライドインします。

于 2011-04-29T06:35:35.297 に答える