0

ここに画像の説明を入力してくださいボタンを押すとQRコードSDKを使用していますが、そこにpresentModalViewがあり、情報ボタンが表示されます。別のペン先にリンクして、どのように機能するかについての情報を表示したかったのです。

-(IBAction)QRscan;
    {       
        //Make sure we can even attempt barcode recognition, (i.e. on a device without a camera, you wouldn't be able to scan anything).
        if([SKScannerViewController canRecognizeBarcodes])
        { 
            SKScannerViewController *scannerVC = [[SKScannerViewController alloc] init]; //Insantiate a new SKScannerViewController
            scannerVC.delegate = self;
            scannerVC.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelTapped)];

            UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight];
            [button addTarget:self action:@selector(settingsTapped) forControlEvents:UIControlEventTouchUpInside];
            UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithCustomView:button];
            scannerVC.navigationItem.rightBarButtonItem = infoItem; 
            scannerVC.title = @"Scan a QRcode";
            qrtest.text = @""; //Reset our info text label.
            scannerVC.shouldLookForQRCodes = YES;//QRCode Checker
            UINavigationController *_nc = [[[UINavigationController alloc] initWithRootViewController:scannerVC] autorelease]; //Put our SKScannerViewController into a UINavigationController. (So it looks nice).
            [scannerVC release];
            [self presentModalViewController:_nc animated:YES]; //Slide it up onto the screen.
        }


- (void) settingsTapped {

    qrcode_info *otherVC = [[qrcode_info alloc] initWithNibName:@"qrcode_info" bundle:Nil  ];

    [self presentModalViewController: otherVC animated:YES];
    [otherVC release];
}
4

2 に答える 2

0

_nc viewControllerにsettingsTapped関数を追加する必要があります。これは、モーダルビューコントローラー(_nc)の内部から呼び出されるため、その上に別のモーダルビューコントローラーを提示する必要があります。

Appleのガイドラインでは、情報画面を「反転」させ、別のモーダルビューコントローラを使用しないことを推奨しています。(タップしたときの天気アプリの動作を参照してください)

于 2011-03-10T12:50:37.557 に答える
0

許可されていないモーダルビューコントローラーでモーダルビューコントローラーを表示しようとしています。
サブビューをカメラビューに追加する必要があります。

于 2011-03-29T08:47:00.637 に答える