I've been using the fantastic [[UINavigationBar appearance] set...
to set application wide appearances for my UI. However, I'm using the SKStoreProductViewController
and want to remove all of my styling so that it shows the default Apple UI. Weirdly, without doing anything, I get a mish mash of normal UI and my custom UI, which I don't really understand. I've tried countering all my UI changes like this:
[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];
But that doesn't seem to work, making no difference at all. How can I set it back to the default UI settings?
Regards,
Mike
Click Settings > All Settings in the menu bar. In the User Accounts grouping, click Manage Accounts. Select a user, and click Edit. Scroll down to Default Menu Bars and Views, and select top menu bars from the lists.
In the Safari app , you can choose the layout that works best for you. Depending on the layout, the search field appears at the top (Single Tab layout) or bottom (Tab Bar layout) of the screen. Go to Settings > Safari, then scroll down to Tabs. Select either Tab Bar or Single Tab.
Ok then, I've had to resort to a nasty little workaround to fix this issue. While I always knew that this would be one way of doing it, I didn't want to have to resort to it because it feels messy.
I subclassed UINavigationController
to something like CustomNavigationViewController
and made absolutely no changes to it. So in other words, it IS UINavigationController
but with a different name. I then used:
[[UINavigationBar appearanceWhenContainedIn:[CustomNavigationViewController class], nil] set....
to set the appearance, applying it only to those NavigationControllers that are of my custom class. The SKStoreProductViewController
obviously isn't of my custom class, and therefore doesn't get the styling for it.
This is a nasty, unclean fix in my opinion, but it works.
Mike.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With