To Find the problem label(s) in a large storyboard, follow my steps below.
In xCode's Issue Navigator right click on the error and select "Reveal In Log". (Note: @Sam suggests below, look in xCode'sreport navigator. Also @Rivera notes in the comments that "As of Xcode 6.1.1, clicking on the warning will automatically open and highlight the conflicting label". I haven't tested this).
This will show the error with a code at the end of your storyboard file. Copy the value after .storyboard
Next, reveal your storyboard as source file.
Search. You should be able to tell what label it is from here quite easily by looking at the content.
Once you find the label the solution that worked for me was to set the "preferred width" to 0.
BTW, you can always quickly get the id of an interface item by selecting the item and looking under the identify inspector. Very handy.
参考:http://stackoverflow.com/questions/25398312/automatic-preferred-max-layout-width-is-not-available-on-ios-versions-prior-to-8
网友评论