SKStoreProductViewController的问题
jjjjjeffrey查了很多资料,没有找到合适的解决方案,就是如何自定义这个viewController的NavigationBar?
征求解决方案,谢谢!
把这个vc放到一个new的NavigationViewController里,然后弹出,不可以么?
2楼 @jjjjjeffrey 文档里面也没有说不能放,试试再说吧
App的Navigationbar是这样的。
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后的效果:
present后的效果:
这效果要哭了。。。
为毛这个viewController不能像UIImagePickerController设计的一样,方便自定义。。。
如果你会用
[[UINavigationBar appearance]
那么再找找
[[UINavigationBar appearanceWhenContainedIn:[XXNavController class], nil]
的用法
那么你这个问题就解决了 锻炼一下找答案的能力
另外 UIImagePickerController是一个UINavigationController 不是UIViewController