我通过将 statusBar 添加为 UIView 组件解决了这个问题,它是解决方案的一种解决方法。我也面临类似的问题。
SKStoreProductViewController *_apsvc = [[SKStoreProductViewController alloc]init];
_apsvc.delegate = self;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
UIView *addStatusBar = [[UIView alloc] init];
//change this to match your navigation bar
UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
addStatusBar.frame = CGRectMake(0, 0, viewController.view.frame.size.width, 20);
addStatusBar.backgroundColor =[UIColor whiteColor];
}
UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
if (viewController)
{
[[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:_apsvc animated:YES completion:^()
{
[_apsvc loadProductWithParameters:@{SKStoreProductParameterITunesItemIdentifier : AppID}
completionBlock:^(BOOL result, NSError *error) {
if(error)
{
....
}
}];
[viewController.view addSubview:addStatusBar];
}];
}
}
-(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
{
[addStatusBar removeFromSuperview];
if (viewController)
{
[viewController dismissViewControllerAnimated:YES completion:nil];
}
}