Mac*_*y18 7 iphone objective-c ios
我一直在使用神奇的功能[[UINavigationBar appearance] set...为我的UI设置应用程序的外观.但是,我正在使用SKStoreProductViewController并希望删除所有样式,以便显示默认的Apple UI.奇怪的是,没有做任何事情,我得到了一个普通的UI和我的自定义用户界面,我真的不明白.我试过反击我的所有UI更改,如下所示:
[storeController.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
[storeController.navigationController.navigationBar setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
nil, UITextAttributeTextColor,
nil, UITextAttributeTextShadowColor,
nil]];
[storeController.navigationController.navigationBar setTitleVerticalPositionAdjustment:0 forBarMetrics:UIBarMetricsDefault];
[storeController.navigationController.navigationItem.leftBarButtonItem setBackgroundVerticalPositionAdjustment:0 forBarMetrics:UIBarMetricsDefault];
Run Code Online (Sandbox Code Playgroud)
但这似乎不起作用,根本没有任何区别.如何将其重新设置为默认的UI设置?
问候,
迈克
那么,我不得不求助于一个讨厌的小解决方法来解决这个问题.虽然我一直都知道这是一种做法,但我不想诉诸它,因为它感觉很乱.
我继承UINavigationController了类似的东西,CustomNavigationViewController并且完全没有改变它.换句话说,它是UINavigationController一个不同的名称.然后我用了:
[[UINavigationBar appearanceWhenContainedIn:[CustomNavigationViewController class], nil] set....
设置外观,仅将其应用于我的自定义类的NavigationControllers.该SKStoreProductViewController显然不是我的自定义类,因此没有得到造型吧.
在我看来,这是一个令人讨厌的,不洁净的修复,但它确实有效.
麦克风.
| 归档时间: |
|
| 查看次数: |
4506 次 |
| 最近记录: |