当dismissViewControllerAnimated时,ios 8中的旋转方向问题

时间:2015-07-30 14:18:09

标签: objective-c uitableview ios8 uiinterfaceorientation presentviewcontroller

我正在使用mobiscan库来扫描条形码。完成条形码扫描后,我关闭当前屏幕并强制旋转到纵向模式。 某些时候出现空白屏幕几秒钟然后正确显示 此问题仅在ios 8中生成。 它在ios 7中正常工作。只有在横向模式下扫描条形码时才会生成此问题。

以下是可以在我的应用中生成的问题的代码和快照。

if(![UICommonUtils isiPad]) {
        // Force the iPhone or iPod to display the TableViewController in portrait mode.
        if (![self.presentedViewController isBeingDismissed])
        {
            UIApplication* application = [UIApplication sharedApplication];
            if (application.statusBarOrientation != UIInterfaceOrientationPortrait)
            {
                UIViewController *c = [[[UIViewController alloc] init] autorelease];
                [c.view setBackgroundColor:[UIColor clearColor]];
                [self presentViewController:c animated:NO completion:^{

                    // Made changes for Issue#2 (When Compiler level flag -DUSE_AUTOLAYOUT=0) as per iOS8 Competibility.
                    if([UICommonUtils checkIfiOS8])
                    {
                        [self performSelector:@selector(dismissSheet) withObject:nil afterDelay:0];
                    }
                    else
                    {
                        [self dismissViewControllerAnimated:NO completion:nil];
                    }
                }];
            }
        }
    }  
-(void)dismissSheet
{
    [self dismissViewControllerAnimated:NO completion:nil];
}  

In snapshot show the issue after completion of barcode scanning.

任何解决方案我该如何解决?

0 个答案:

没有答案