【问题标题】:How to put an NSView below the titlebar in a NSViewController?如何在 NSViewController 的标题栏下方放置一个 NSView?
【发布时间】:2017-08-24 16:53:37
【问题描述】:

我的应用架构如下:MainWindowController用MainWindow初始化,初始化后MainWindowController创建一个MainViewController和将其分配给 contentViewController 属性。

现在我想在 MainViewController 中添加一些控件。当我使用 AutoLayout 在视图控制器顶部放置一个 NSTextFiled 时,textField 被 MainWindow 的标题栏遮蔽。如何添加一个约束来定位标题栏正下方的 textField(在 iOS 中,我可以使用 topLayoutGuide)?

【问题讨论】:

    标签: macos cocoa


    【解决方案1】:

    我找到了一个解决方案:当我初始化 MainWindow 时,我使用 fullSizeContentView 标志。删除标志后,一切正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-27
      • 2021-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多