显示 Xcode 11 中缺少助理编辑器?

Show Assistant Editor missing in Xcode 11?

在Xcode10中,工具栏有一个互锁环图标,显示助理编辑器,在Xcode11中没有。

快捷方式 :

  • control + option + command + return : 显示助理编辑器
  • command + return : 仅显示编辑器(隐藏助理编辑器)

使用工具栏上的编辑器

In Xcode 10, the toolbar had an inter-locking ring icon which showed the assistant editor, it's missing in Xcode 11.

界面略有变化,但功能还在。编辑器面板右上角有两个按钮:

单击看起来像文本行的左侧按钮会显示弹出菜单,您可以在其中选择各种编辑器配置选项。单击右键只会缩小现有编辑器的范围,并在其旁边添加另一个编辑器。

主菜单栏的“编辑器”菜单中也提供了一些相同的选项。


更新: 这是来自 Xcode 11 beta release notes,也许更全面地解释了 UI 被更改的原因:

Editors can be added to any window without needing the Assistant Editor. Editors are added using the “Add Editor” button in the jump bar or the File > New > Editor command. Each editor can now be in one of three modes: “Editor Only”, “Editor and Assistant” or “Editor and Canvas”. The latter two modes automatically show relevant content when available. When using multiple editors, the View > Editor > Focus command can be used to temporarily expand the active editor to fill the entire window, hiding other editors. For source control support, the Code Review button in the Toolbar replaces the Comparison Editor. The “Show Authors” command is now available from the Source Editor’s Editor menu. The SCM Log is now in the Inspector Area. (43806898)

在 window 中可以使用多个编辑器,您需要 editor-specific 控件来显示辅助视图,如辅助编辑器、作者视图等。


来自 SMGreenfield 的评论:

Sometimes I want to look at a different part of the same darn document. There has always been a way to do this, but it involved jumping through hoops.

只需添加另一个编辑器:单击编辑器右上角的“添加编辑器”按钮,或选择文件 > 新建 > 编辑器。新编辑器将默认显示您在现有编辑器中处理的同一文件。

如果新编辑器出现在现有编辑器的右侧,并且您希望它们垂直堆叠,您可以选择查看 > 更改编辑器方向。如果您希望它们大部分时间水平堆叠(默认设置)但只希望其中一个显示在下方,请选择 文件 > 新建 > 下面的编辑器

在 Xcode11 中,我们现在有多个编辑器窗格。您可以召唤第二个窗格、第三个窗格,随心所欲。

当你有第二个面板时,它不一定是自动助手。换句话说,编辑器窗格 本身 要么是助手,要么不是。因此,如果不是,则为手动。如果是,它是自动的。

要在助手和普通窗格之间切换,请从编辑器菜单中选择助手:

  • 如果选中,则这是一个自动助手。它显示的内容自动取决于其他一些窗格。

  • 如果助手未选中,这是一个普通的编辑器面板,是手动的。您可以在此编辑器中显示任何您喜欢的内容。

它已移动,要显示它,请单击带有水平线的图标和 select 助手。

如果您不能使用 Add Editor 按钮,请使用快捷方式: Cmd + Ctrl + Shift + Enter

对于Xcode 11.2.1

命令 + 选项 + return

主菜单 -> 编辑器 -> 线视图

值得注意的是,您还可以通过按住 alt 并单击文件来打开辅助编辑器

导航至 Xcode 11 中的以下内容以打开 Google 助理:-

Xcode > 编辑 > 助理