iOS的7导航栏SKStoreProductViewController [英] iOS 7 Nav Bar SKStoreProductViewController

查看:820
本文介绍了iOS的7导航栏SKStoreProductViewController的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iOS 6中,SKStoreProductViewController被引入,以显示应用程序的iTunes Store的项目,这样用户就不必离开应用程序来查看它们。

In iOS 6, SKStoreProductViewController was introduced to show iTunes Store items in apps, so the user would not have to leave the app to view them.

到目前为止,我还没有找到一个方法来定制这个视图控制器的导航栏。在iOS 6中,是黑灰色的写作,并在搭载iOS 7,这是白加黑的写作。

So far, I have not found a way to customize the navigation bar of this view controller. In iOS 6, it is black with grey writing, and in iOS 7, it is white with black writing.

有没有办法来改变导航栏的色调颜色? (在iOS 6中和放大器;运行iOS 7)

Is there any way to change the navigation bar's tint color? (In iOS 6 & iOS 7)

感谢。

推荐答案

不是最好的解决办法,但你可以使用UINavigationBar的的UIAppearance方法来设置颜色你展示它之前:

Not the nicest solution but you can use UINavigationBar's UIAppearance method to set the colour just before you show it:

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

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

然后在SKStoreProductViewControllerDelegate方法,它变回不管它是previously ...

And then in the SKStoreProductViewControllerDelegate method, change it back to whatever it was previously...

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

我的作品。

这篇关于iOS的7导航栏SKStoreProductViewController的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆