1

我有一个应用程序,其中我的 xib 中有一个 UIView(Zbarsdk 阅读器视图)。点击按钮时,应加载该视图。但实际上,当点击按钮时,前一个视图首先正在加载(我从中进入了我的视图)。但是在运行一次然后再次运行之后,正确的视图正在加载吗?(从登录我回到家。在家里我有一个按钮来加载我的xib中单独的一个视图,但是当第一次运行时它再次加载登录屏幕。但是当你在模拟器中再次运行该代码时不会删除该构建正在加载正确的视图)。有人知道为什么吗?

- (IBAction) tappressed
{
    // ADD: present a barcode reader that scans from the camera feed
    ZBarReaderViewController *reader = [ZBarReaderViewController new];
    reader.readerDelegate = self;
    [reader willRotateToInterfaceOrientation:UIInterfaceOrientationPortrait duration:0];
    //[self.readerView willRotateToInterfaceOrientation:orient duration:0];
    //reader.supportedOrientationsMask = ZBarOrientationMask(UIInterfaceOrientationLandscapeRight);

    // [reader shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
    //reader.supportedOrientationsMask = ZBarOrientationMask(UIInterfaceOrientationLandscapeLeft);
    reader.sourceType=UIImagePickerControllerSourceTypeCamera;
    // UIImageView *overlayImage=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"overlaygraphic.png"]];
    //overlayImage.bounds=CGRectMake(50, 75, 320-100, 480-150);

    reader.cameraOverlayView=cameraOverlay;
    ZBarImageScanner *scanner = reader.scanner;
    // TODO: (optional) additional reader configuration here

    // EXAMPLE: disable rarely used I2/5 to improve performance

    [scanner setSymbology: ZBAR_I25
             config: ZBAR_CFG_ENABLE
             to: 0];

    // present and release the controller
    [self presentModalViewController:reader animated:YES];

    // [self.view addSubview:reader.view];
    [reader release];
}
4

0 回答 0