1

我正在使用 SKStoreProductViewController 在我的应用中打开应用商店。它显示成功,但其中的状态栏没有显示,导航栏看起来像一个 44 像素的高度。但它不会在任何设备的任何 iOS 8.3v 中发生。这种情况只发生在所有 iOS 8.4v 设备中。

在我的 plist UIViewControllerBasedStatusbarAppearance 设置为 NO。我也试过是,但没用。

在此处输入图像描述

状态栏中的红色是超级视图导航栏颜色。

注意:我从我的 ParentViewController 展示 SKStoreProductViewController。

任何帮助将不胜感激。

4

1 回答 1

0

我通过将 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];
       }
    }
于 2015-09-13T05:59:49.893 回答