プログラミングと音楽とアニメとiPhoneとiPadとMacとAndroidとLogicとギターとテニスと車

アプリ開発系の勉強メモやTipsなどを中心に他いろいろと書いていきます。

AutoLayoutのエラー対処

エラー内容

The selected views have no constraints. At build time explicit left, top, width, and height constraints will be generated for the view.

 

XcodeのUse Auto Layoutにチェックを入れると、

通常は下記画像のようにConstraintsでAutoLayoutの調整ができますが、上のエラーが表示されてConstraintsの表示が消えている時がありました。

f:id:travitu:20140426151855j:plain 

そうなった場合の対処方法は、

Editor > Resolve Auto Layout Issues > Add missing constraints in View Controller

と選択すればConstraintsが表示されます。

f:id:travitu:20140426151912j:plain