在 Xcode 7 中清除所有 XIB/Storyboard 文件中的所有警告的最快方法是什么 [英] What is the quickest way to clean up all warnings in all XIB / Storyboard files In Xcode 7

查看:28
本文介绍了在 Xcode 7 中清除所有 XIB/Storyboard 文件中的所有警告的最快方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Xcode 中,每当我看到 XIB/Storyboard 中出现警告(通常是关于错位元素)时,我必须:

In Xcode, whenever I see warnings (usually about misplaced elements) appear in the XIB / Storyboard, I have to:

  1. 选择容器(通常是包含视图控制器或最顶部的视图)
  2. 从 Xcode 菜单中选择 Editor -> Resolve Auto Layout Issues -> All views in -> 适当的操作(例如:更新框架)来解决问题.
  1. Select the container (Usually the containing view controller or the top most view)
  2. From the Xcode menu select Editor -> Resolve Auto Layout Issues -> All views in <container name> -> Appropriate action ( For instance: Update frames) to resolve the issues.

上述方法需要一些步骤,对我来说有点耗时.如果我可以:- 解决故事板/XIB 文件中所有视图控制器的所有警告- 更好地解决项目中可用的所有故事板/XIB 文件的所有警告

The above method takes requires steps and a bit time consuming to me. It would be great if I could: - Resolve all warnings for ALL view controllers in a storyboard/XIB file - Even better resolve ALL warnings of all storyboard/XIB files available in the project

如果您有任何想法,请提供建议.谢谢!

If you have any idea please advise. Thanks!

推荐答案

尝试了很多方法后,我认为这是目前我所知道的最快的方法:

After trying many ways, I think for now this is the quickiest method I know:

  1. 打开 Xcode 问题导航器(见下图)
  2. 在底部的文本框中键入 frame for 以过滤布局问题.
  3. 一一点击警告,然后按Command + Option + =.
  1. Open the Xcode issue navigator (see the image below)
  2. Type frame for in the text box at the bottom to filter layout issues.
  3. Click on the warning one by one and press Command + Option + =.

就是这样!

我个人也发现这样做可以显着缩短点击所有警告的时间:

Personally I also found out that doing this way can significantly shorten the time to click through all warnings:

  1. 用左手食指按下左Command
  2. 用左手的中指按下左option(或alt)键
  3. 使用右手小指按下=
  4. 用右手拇指点击触摸板,但不要在触摸板上移动它,这样我总是可以点击第一个警告

这篇关于在 Xcode 7 中清除所有 XIB/Storyboard 文件中的所有警告的最快方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆