LoginSignup
7
6

More than 3 years have passed since last update.

[Xcode11]StoryboardでSuperViewへのEqualWidth,EqualHeightができなくなった時の解決法

Posted at

はじめに

Xcode11でstoryboardを使っていて、ViewをSuperViewと同じ横幅にしようと思ったのですが、ViewをSuperViewへドラッグしたところEqualWidthsは見当たりませんでした、

問題

Xcode11以前はStoryboardでViewなどをドラッグしてSuperViewに合わせると

qii.png

このようなメニューが出てきて、EqualWidthsを選択するとEqual Widths Constraintをつけることができました

スクリーンショット 2019-10-10 23.42.10.png

しかし、Xcode11では同じ操作をするとこのような画面になり、メニューからEqualWidths,EqualHeights,Aspect Ratioが消えてしまいました。

スクリーンショット 2019-10-10 23.45.08.png

回避策

先ほどSuperViewへドラッグした操作をSafeAreaに変更すると、EqualWidths,EqualHeights,Aspect Ratioが出現するので選択します。

スクリーンショット 2019-10-10 23.46.02.png

そうするとこのような感じになりますので、Second Itemの欄からSuperViewを選択してあげると

スクリーンショット 2019-10-10 23.46.14.png

SuperViewと同じ高さにしてあげることができました

スクリーンショット 2019-10-10 23.46.34.png

参考リンク

Xcode 11 Add "Equal Width to Superview" Constraint?

Cannot equal height to Superview in Xcode 11

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6