问题
In Xcode, whenever I see warnings (usually about misplaced elements) appear in the XIB / Storyboard, I have to:
- 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.
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!
回答1:
After trying many ways, I think for now this is the quickiest method I know:
- 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 + =
.
That's it!
Personally I also found out that doing this way can significantly shorten the time to click through all warnings:
- Use the left hand's index finger to press left
Command
key - Use the left hand's middle finger to press left
option
(oralt
) key - Using right hand's pinky to press
=
key - Use right hand's thumb to click on the touch pad, BUT don't move it on the touch pad so that I can always click on the FIRST warning
来源:https://stackoverflow.com/questions/32630880/what-is-the-quickest-way-to-clean-up-all-warnings-in-all-xib-storyboard-files