SKStoreProductViewController的问题

jjjjjeffrey 发布于 2014年01月16日
无人欣赏。

查了很多资料,没有找到合适的解决方案,就是如何自定义这个viewController的NavigationBar?

征求解决方案,谢谢!

共8条回复
tinyfool 回复于 2014年01月16日

把这个vc放到一个new的NavigationViewController里,然后弹出,不可以么?

jjjjjeffrey 回复于 2014年01月16日

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.

文档里是这么讲的。。。。

tinyfool 回复于 2014年01月16日

2楼 @jjjjjeffrey 文档里面也没有说不能放,试试再说吧

jjjjjeffrey 回复于 2014年01月16日

3楼 @tinyfool 好的,我试下看看。

jjjjjeffrey 回复于 2014年01月16日

3楼 @tinyfool

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后的效果:

jjjjjeffrey 回复于 2014年01月16日

这效果要哭了。。。

jjjjjeffrey 回复于 2014年01月16日

为毛这个viewController不能像UIImagePickerController设计的一样,方便自定义。。。

adad184 回复于 2014年01月16日

如果你会用

 [[UINavigationBar appearance]

那么再找找

[[UINavigationBar appearanceWhenContainedIn:[XXNavController class], nil]

的用法

那么你这个问题就解决了 锻炼一下找答案的能力

另外 UIImagePickerController是一个UINavigationController 不是UIViewController

登录 或者 注册
相关帖子