2

私の考えは、whatsapp のように半透明のビューを作成することです。

1) 画像ビューにタップ ジェスチャがあります。

2)画像ビューをタップすると、whatsappのような透明なビューの1つのレイヤーが表示されます

3) 次に、3 つのボタンがあります。新規作成、既存の選択、またはキャンセルです。 絵コンテ

ここからどのように続行しますか?キャンセルを押すと、半透明のUIビューが飛び出すはずです..

4

1 に答える 1

4

UIActionSheetを使用しないのはなぜですか....次のようなものを試してください...

UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
                                                      delegate:self
                                             cancelButtonTitle:@"Cancel"
                                        destructiveButtonTitle:nil
                                             otherButtonTitles:@"Take photo",@"Choose existing", nil];



            actionSheet.actionSheetStyle=UIActionSheetStyleBlackTranslucent;

           [actionSheet showFromRect:[sender frame] inView:self.view animated:YES];

また、デリゲート メソッドでアクションを実装します.....

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    // create an image picker controller
    UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
     imagePickerController.delegate = self;

    if(buttonIndex==0)
    {
    //create image picker with source camera blah blah
    }
else if(buttonIndex==1)
    {
    //choose existing... 
    }
}

あなたは>>のようなものを得るでしょう

ここに画像の説明を入力

于 2013-11-05T13:25:32.360 に答える