查了很多资料,没有找到合适的解决方案,就是如何自定义这个viewController的NavigationBar?
征求解决方案,谢谢!
1楼 @tinyfool To display a store, create a new SKStoreProductViewController object and set its delegate. Then, present the view controller modally from another view controller in your app. Your delegate dismisses the view controller when the user completes the purchase.
文档里是这么讲的。。。。
App的Navigationbar是这样的。
代码如下:
SKStoreProductViewController *productVC = [[SKStoreProductViewController alloc] init];
productVC.delegate = self;
NSDictionary *parameters = @{SKStoreProductParameterITunesItemIdentifier: @"333206289"};
[productVC loadProductWithParameters:parameters completionBlock:^(BOOL result, NSError *error){
if (result) {
[self hideHud:YES afterDelay:0];
DQNavigationController *nav = [[DQNavigationController alloc] initWithRootViewController:productVC];
[self presentViewController:nav animated:YES completion:^{}];
} else {
//跳转appstore做法
NSString *string = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/us/app/id%@?mt=8", @"333206289"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:string]];
}
}];
present后的效果: