Does the StoreKit SKStoreProductViewController leave space between the navigation bar and the view?

I have this subclass of UIViewController that shows SKStoreProductViewController . This view controller was originally created for iOS 5 and does NOT use auto-layout. My problem is that when the SKStoreProductViewController is SKStoreProductViewController , there is a space between the navigation bar and the actual content ... if you scroll the view, the segmented control (Details / Reviews / Related) floats under the navigation bar (see images below, I added a mask to images to make the problem more obvious).

Since we do not have access to the presented view controller, I assume that it is connected to the controller that represents the SKStoreProductViewController . When the user presses the button representing the controller, I tried to change / shift the view frame, I also did something like self.navigationController.navigationBar.translucent = NO; but nothing helps.

Has anyone had a similar problem? Any ideas on how to fix this?

Showing space between navigation bar and viewShowing the segmented control bar floating

+2
source share
1 answer

There seems to be a bug in the UIAppearance protocol on iOS 7. I found that people have (other) problems when using UIAppearance . I used something like:

[[UINavigationBar appearance] setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

which works on iOS 5, but for iOS 6+ I set the background image directly in the navigation bar:

[self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];

It seems like a little difference, but it fixed my problem.

0
source

Source: https://habr.com/ru/post/1203918/


All Articles