【发布时间】:2018-02-18 19:58:05
【问题描述】:
我在界面生成器中有以下场景。
以及控制器viewDidLoad函数中的如下代码
print(String.init(format:"baseCircleView width %f height %f", baseCircleView.bounds.size.width, baseCircleView.bounds.size.height))
print(String.init(format:"userDrawingView width %f height %f", userDrawingView.bounds.size.width, userDrawingView.bounds.size.height))
print(String.init(format:"View width %f height %f", self.view.bounds.size.width, self.view.bounds.size.height))
当我启动应用程序时(在 iPhone6 模拟器上,但在情节提要中选择了“查看为:iPhone SE”),我在控制台中有以下内容:
baseCircleView 宽度 320.000000 高度 504.000000
userDrawingView 宽度 320.000000 高度 504.000000
视图宽度 375.000000 高度 667.000000
我不明白为什么我的 2 个视图从情节提要中选择的设备“View as : iPhone SE”而不是它们的超级视图推断它们的大小。
谁能帮我找出问题所在?
【问题讨论】:
标签: ios iphone swift uiview interface-builder