StoreKit的SKStoreProductViewController在导航栏和视图之间是否留有空间? [英] StoreKit's SKStoreProductViewController leaving space between the nav bar and the view?

查看:76
本文介绍了StoreKit的SKStoreProductViewController在导航栏和视图之间是否留有空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有UIViewController的这个子类,它显示了 SKStoreProductViewController .此视图控制器最初是为iOS 5创建的,未使用自动布局.我的问题是,当显示 SKStoreProductViewController 时,导航栏和实际内容之间有一个空格...如果滚动视图,则分段控件(详细信息/评论/相关)将浮动在导航栏(请参见下面的图像,我在图像上添加了蒙版以使问题更明显).

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

由于我们无权访问呈现的视图控制器,因此我猜测它与呈现 SKStoreProductViewController 的控制器有关.当用户点击显示控制器的按钮时,我尝试更改/移动视图框架,我也做了类似 self.navigationController.navigationBar.translucent = NO; 的操作,但是似乎没有什么帮助.

Since we don't have access to the presented view controller I'm guessing it has to do with the controller that presents the SKStoreProductViewController. When the user taps on the button that presents the controller I've tried to change/shift the frame of the view, I've also done something like self.navigationController.navigationBar.translucent = NO; but nothing seems to help.

有人遇到过类似的问题吗?关于如何解决它的任何想法?

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

推荐答案

iOS 7上的 UIAppearance 协议似乎有一个错误,我发现人们有( other )使用 UIAppearance 时出现问题.我在用类似的东西:

It seems like there's a bug on the UIAppearance protocol on iOS 7. I found people having (other) problems when using UIAppearance. I was using something like:

[[[UINavigationBar外观] setBackgroundImage:BarMetrics的图像:UIBarMetricsDefault];

可在iOS 5上使用,但是对于iOS 6+,我直接在导航栏上设置背景图片:

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

[self.navigationController.navigationBar setBackgroundImage:BarMetrics的图像:UIBarMetricsDefault];

看似很小的差异,但它解决了我的问题.

It looks like a small difference, but it fixed my problem.

这篇关于StoreKit的SKStoreProductViewController在导航栏和视图之间是否留有空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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