setAutoresizingMask 不起作用
setAutoresizingMask doesn't work
我正在尝试编写本教程中的程序:
在我的代码中设置以下代码片段后,没有任何变化。
[[_ourViewController view] setAutoresizingMask:NSViewHeightSizable| NSViewWidthSizable];
当我运行应用程序时,视图仍然在左上角。
为什么这行不通?
此致,
罗比
我找到了解决方案!您必须在 der Interface Builder 中使用 constraints
!
我正在尝试编写本教程中的程序:
在我的代码中设置以下代码片段后,没有任何变化。
[[_ourViewController view] setAutoresizingMask:NSViewHeightSizable| NSViewWidthSizable];
当我运行应用程序时,视图仍然在左上角。
为什么这行不通?
此致, 罗比
我找到了解决方案!您必须在 der Interface Builder 中使用 constraints
!