gpt4 book ai didi

iOS 7 导航栏 SKStoreProductViewController

转载 作者:可可西里 更新时间:2023-11-01 03:37:30 25 4
gpt4 key购买 nike

在 iOS 6 中,引入了 SKStoreProductViewController 以在应用程序中显示 iTunes Store 项目,因此用户无需离开应用程序即可查看它们。

到目前为止,我还没有找到自定义此 View Controller 的导航栏的方法。在iOS 6中为黑底灰字,在iOS 7中为白底黑字。

有没有办法改变导航栏的色调? (在 iOS 6 和 iOS 7 中)

谢谢。

最佳答案

这不是最好的解决方案,但您可以使用 UINavigationBar 的 UIAppearance 方法在显示之前设置颜色:

[[UINavigationBar appearance] setTintColor:[UIColor darkGrayColor]];

SKStoreProductViewController *storeProductViewController = [[SKStoreProductViewController alloc] init];
[storeProductViewController setDelegate:self];
[self presentViewController:storeProductViewController animated:YES completion:nil];

然后在 SKStoreProductViewControllerDelegate 方法中,将其更改回之前的任何内容...

-(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController {
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
[viewController dismissViewControllerAnimated:YES completion:nil];
}

对我有用。

关于iOS 7 导航栏 SKStoreProductViewController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18838727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com