UIScrollView의 AutoLayout 설정 시도

Development Environment

  • OS X El Captain 10.11.2
  • Xcode Version 7.3.1
  • Language


    Swift

    Process


    Step 1: Add Scroll View and View from the object library

    Step 2: Tap to select Scroll View and then tap Pin where Auto-Layout setting appears. After that, set Auto layout like following figure.
    ※Please make sure that remove check mark on "Constrain to margins"and border surrounding the white box turns to be red colour. Then, press "Add 4 Constraints"to confirm your setting.

    Step 3: Exactly do the same setting as Step 2 to View under Scroll View. Tap to select View under Scroll View and then tap Pin where Auto-Layout setting appears. After that, set Auto layout like following figure.
    ※Please make sure that remove check mark on "Constrain to margins"and border surrounding the white box turns to be red colour. Then, press "Add 4 Constraints"to confirm your setting.

    Step 4: Select View under Scroll View and press control key and drag to "View". After that, select Equal Widths and Equal Height like following gif image.

    Step 5: Change the priority of Height from Step 4. Change it from 1000 to 250 like following gif image.
    ※If your Scroll View size is not the same as View, warning still appears and you have to go Step 6 to fix. If the size is same, warning will disappear and finally finish setting Auto-Layout of Scroll View. Congrats!

    (Optional)Step 6: If the size of Scroll View is not the same as View Size, warning will appear. Tap yellow warning icon to fix constraint like following gif image. Then, done with Auto-Layout of Scroll View.

    다행이다!!!!!

    좋은 웹페이지 즐겨찾기