在 Xcode 7 中清除所有 XIB/Storyboard 文件中的所有警告的最快方法是什么 [英] What is the quickest way to clean up all warnings in all XIB / Storyboard files In Xcode 7
问题描述
在 Xcode 中,每当我看到 XIB/Storyboard 中出现警告(通常是关于错位元素)时,我必须:
In Xcode, whenever I see warnings (usually about misplaced elements) appear in the XIB / Storyboard, I have to:
- 选择容器(通常是包含视图控制器或最顶部的视图)
- 从 Xcode 菜单中选择
Editor
->Resolve Auto Layout Issues
->All views in
-> 适当的操作(例如:更新框架
)来解决问题.
- Select the container (Usually the containing view controller or the top most view)
- 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:
- 打开 Xcode 问题导航器(见下图)
- 在底部的文本框中键入
frame for
以过滤布局问题. - 一一点击警告,然后按
Command + Option + =
.
- Open the Xcode issue navigator (see the image below)
- Type
frame for
in the text box at the bottom to filter layout issues. - 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:
- 用左手食指按下左
Command
键 - 用左手的中指按下左
option
(或alt
)键 - 使用右手小指按下
=
键 - 用右手拇指点击触摸板,但不要在触摸板上移动它,这样我总是可以点击第一个警告
这篇关于在 Xcode 7 中清除所有 XIB/Storyboard 文件中的所有警告的最快方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!