iOS8大小类和弹出视图 [英] iOS8 Size-Classes and Popover Views

查看:135
本文介绍了iOS8大小类和弹出视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在最近工作的iPad应用程序上遇到了Popover的问题...我会在这里发布它,因为我觉得它可以帮助其他人。

I had an issue with Popover on an iPad app I was working on recently...going to just post it here as I think it may help others.

我正在使用Xcode 6和iOS 8以及Size Classes,并且Popover View是在Storyboard中构建的。

I'm using Xcode 6 and iOS 8 and Size Classes and the Popover View was built in a Storyboard.

因为我的iPad应用程序是常规/常规大小类所有我也在R / R中构建了Popover视图。

As my iPad App is in Regular/Regular Size Class all the time I built the Popover view in R/R too.

不管我对Constraints做了什么,弹出窗口从来没有看起来正确,这是一团糟。那是怎么回事?

No matter what I did with Constraints though, the popover just never looked right, it was a mess. So what was wrong??

推荐答案

经过一段时间后,便士一直在检查Any / Any Size类的限制....这些与我在日志中吐出的错误约束相匹配。所以我在A / A尺寸类中设计了Popover视图并且工作正常!

After some time the penny dropped to check the Any/Any Size class constraints.... These were matching the erronous constraints that I was spitting out in the logs. So I designed the Popover view in the A/A size class and it worked fine!

这对某些人来说似乎很明显,但我认为这是因为我的应用程序是R / R我的Popover约束应该在R / R中。但是,如果您使用VC作为Popover,则需要在A / A Size Class中进行约束。

This might seem obvious to some but I thought that because my App was R/R that my Popover constraints should be in R/R. However it looks like that if you are using a VC as a Popover that the constraints need to be made in the A/A Size Class.

这篇关于iOS8大小类和弹出视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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