1
2

More than 3 years have passed since last update.

[iOS]AutoLayoutでviewをコピペしたらAuthLayoutが効かなくなってしまう問題への対応方法

Posted at

長いこと謎だったんですが、UIStoryboard内のUIViewController直下のviewをコピーして貼り付けると、AutoLayoutができない状態になりますよね。

イメージ:ここの選択してるviewをコピペすると、上のようにSafeAreaがくっついてきて

スクリーンショット 2020-10-16 16.15.17.png

Autolayoutができない状態に!

スクリーンショット 2020-10-16 16.16.57.png

解決するには

どうやらLayoutがAutoresizingMask(AutoLayout切ってる旧レイアウト状態)になってるのでInferredに変更します。

スクリーンショット 2020-10-16 16.16.09.png

あと、一番下のSafe Area Layout Guideをオフにします。

解決できてスッキリ

CreatedAt: 2020/10/16 iOS14, Xcode12

1
2
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
1
2