0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

UIScrollView Swift

Posted at

UIScrollViewの使用方法(storyboard)

①UIscrollViewをviewControllerに配置する。
スクリーンショット 2021-09-17 8.17.37.png

②Autolayoutを上下左右すべて0にする
③UIscrollViewの上にViewを配置する(背景色を変えるとわかりやすいかも)

スクリーンショット 2021-09-17 8.13.07.png

④配置したViewとUIScrollviewをCmd押しながら同時選択して、右下のAdd New Aligment Constraintを選択してLeading Edges,Trailing Edges,Top Edges,BottomEdgesをすべて0に設定する
スクリーンショット 2021-09-17 8.13.21.png

⑤viewからScrollViewの下にあるFrame Layout Guideに対してcontrolキーを押しながらドラッグアンドドロップをして、Equal Widthを選択する
⑥置いたviewのheightの制約をかける。その制約の分スクロールするようになる。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?