自动布局+大小类问题迅速 [英] Auto layout + size classes issue in swift
问题描述
在上述观点,viewB是viewA的子视图创建使用厦门国际银行和约束还增加了厦门国际银行。 viewB有约束的顶部,底部,导致与放大器;尾随相对于它的父。文件所有者是迅速的视图控制器。 viewB与文件所有者连接
In the above view, viewB is a subview of viewA created using an xib and the constrains also added in the xib. viewB has constrains top, bottom, leading & trailing relative to its superview. The file owner is swift view controller. viewB is connected with the file owner
@IBOutlet weak var viewB: UIView!
但是,当我在ipad上运行iOS运行项目8 viewB是不可见的? (在iPhone它是可见的)
我试图访问其帧viewDidLoad中和放大器; viewDidAppear,它是(0.0,0.0,0.0,0.0)
But when I run the project in iPAD running iOS 8 the viewB is not visible? (in the iPhone it is visible) I tried to access its frame in viewdidLoad & viewDidAppear, it is (0.0,0.0,0.0,0.0)
这是在我的项目的唯一快捷视图控制器,其他所有的意见和放大器; VC是objc。
This is the only swift view controller in my project, all the other views & VC are in objc.
难道是迅速的错误还是我试图做一些错了吗?
Is it a bug in swift or am I trying to do something wrong?
推荐答案
此问题已得到解决。
这是在厦门国际银行有关大小的类。一个约束加入CW和放大器;铑大小。
如果有人碰到这个问题来了,检查厦门国际银行的布局限制了两次:)
The issue is resolved. It was related to size classes in the XIB. One constrain was added to Cw & Rh sizes. If anyone come across this issue, check the xib's layout constrains twice :)
一个很好的参考:的http://adoptioncurve.net/archives/2014/08/working-with-size-classes-in-interface-builder/
这篇关于自动布局+大小类问题迅速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!