Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SafeArea

M
February 02, 2018

 SafeArea

カスタムBarのSafeArea(iPhoneX)対応

M

February 02, 2018
Tweet

More Decks by M

Other Decks in Programming

Transcript

  1. Interface BuilderͷDeployment Target=9.xͰ Ϗϧυͨ͠΋ͷΛiOS8Ͱىಈ͢Δͱ࣮ߦ࣌Τϥʔ Terminating app due to uncaught exception

    'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named UILayoutGuide'
  2. έʔε3ʢiOS9Ҏ߱ʣ 1. SafeArea֎ʹ֦େ͢ΔഎܠviewΛ௥Ճ 2. എܠviewͷԼʢ্ʣΛsuperviewʹ෇͚Δ 3. എܠviewʹίϯςϯπviewΛࢠͱͯ͠௥Ճ 4. എܠviewͷSafeAreaLayoutGuideΛ༗ޮʹ͢Δ 5.

    ίϯςϯπviewͷԼʢ্ʣΛSafeAreaʹ෇͚Δ 6. ίϯςϯπviewͷ্ʢԼʣΛsuperviewʢഎܠviewʣʹ෇͚Δ 7. ίϯςϯπviewͷbackgroundColorΛಁ໌ʹ͢Δ
  3. έʔε3·ͱΊ 1. SafeArea֎ʹ֦େ͢ΔഎܠviewΛ௥Ճ 2. എܠviewͷԼʢ্ʣΛsuperviewʹ෇͚Δ 3. എܠviewʹίϯςϯπviewΛࢠͱͯ͠௥Ճ 4. എܠviewͷSafeAreaLayoutGuideΛ༗ޮʹ͢Δ 5.

    ίϯςϯπviewͷԼʢ্ʣΛSafeAreaʹ෇͚Δ 6. ίϯςϯπviewͷ্ʢԼʣΛsuperviewʢഎܠviewʣʹ ෇͚Δ 7. ίϯςϯπviewͷbackgroundColorΛಁ໌ʹ͢Δ