我正在使用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];
}
任何解决方案我该如何解决?