したがって、複数のオプションを使用してこれらのモーダルプロンプトの1つを描画するクラスの名前に完全に空白を描画しています。スクリーンショットを添付しました。これは、ユーザーがサインアウトするかどうかを確認するプロンプトです。
4 に答える
3
これはUIActionSheet
、UIActionSheetクラスリファレンスを読んでください。
例
<UIActionSheetDelegate>
ヘッダーに、プロトコルを追加する必要があります。次に、@implementation
これはあなたがこの特定のシートをどのように呼ぶかです:
UIActionSheet * sampleSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure you'd like to sign out from Path?" delegate:self
cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Sign Out" otherButtonTitles:nil];
[sampleSheet setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
[sampleSheet showInView:self.view];
そして、これはあなたがシートを扱う方法です:
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
switch ( buttonIndex )
{
case 0:
NSLog(@"User Chose Cancel");
break;
case 1:
NSLog(@"User Chose to Sign out.");
break;
}
}
于 2012-05-04T18:18:43.250 に答える
0
于 2012-05-04T18:20:27.517 に答える
0
UIActionSheetを参照してください。それがあなたが探しているクラスだと思います。
于 2012-05-04T18:21:31.200 に答える
0
UIActionSheet *popupQuery;
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
//give the user an option to choose an image from their library or take a new photo...
popupQuery = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Take Photo", @"Choose From Library", nil];
popupQuery.tag = 0;
}
else {
//give the user an option to choose an image from their library or take a new photo...
popupQuery = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Choose From Library", nil];
popupQuery.tag = 1;
}
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:[self.view window]];
[popupQuery release];
于 2012-05-04T18:22:35.207 に答える