Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Apple公式ガイドを さっくりと読んでまとめてみた UIScrollView編
Search
Atsushi Uchida (utwang)
October 08, 2015
Programming
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Apple公式ガイドを さっくりと読んでまとめてみた UIScrollView編
UIScrollViewとAutolayoutを併用するときのわかりにくかったところのまとめ
Atsushi Uchida (utwang)
October 08, 2015
More Decks by Atsushi Uchida (utwang)
See All by Atsushi Uchida (utwang)
Measurement And Unitを試した話
utwang
0
610
Apple公式ガイドさっくりまとめ ファイルシステム編
utwang
0
71
頻出pryコマンド
utwang
0
150
設計ポイントの 比較で知る Backbone.js
utwang
9
7.1k
Other Decks in Programming
See All in Programming
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
240
Seven New Principles of Software Engineering
yegor256
0
190
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Domain-Driven Transformation
hschwentner
2
2.3k
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
140
[2026-10-09]一枚の布で作らなくてもいい。 信頼性は「パッチワーク」で紡がれる~既存の運用と新しい可能性をつなぎ合わせてきたCREの話~
tosite
0
110
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
730
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
290
オーケストレーション記述言語 Katari
yukikurage
0
170
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.2k
Jetpack Compose Mechanisms
skydoves
3
840
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
Featured
See All Featured
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
440
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
310
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Ruling the World: When Life Gets Gamed
codingconduct
0
410
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Skip the Path - Find Your Career Trail
mkilby
1
260
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
Statistics for Hackers
jakevdp
799
230k
WCS-LA-2024
lcolladotor
0
900
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Transcript
͍·͞ΒAppleެࣜΨΠυΛ ͬ͘͞ΓͱಡΜͰ·ͱΊͯΈͨ ʙ iOS ScrollViewϓϩάϥϛϯάΨΠυฤ ʙ 2015/10/08
͜ͷΨΠυͷओͳ༰ • ScrollViewͷ࡞ͱઃఆ • εΫϩʔϧͷΠϕϯτͱ੍ޚ(delegateϝοηʔδ) • ϐϯνδΣενϟΛͬͨζʔϜ • λοϓͰͷζʔϜ •
ϖʔδϯάϞʔυʹ͍ͭͯ
͜ͷࢿྉͷ༰ • εΫϩʔϧͷઃఆ • ϐϯνΠϯɺϐϯνΞτͷઃఆ • ϋϚͬͨͱ͜Ζ(AutoLayout)
جຊػೳͱߏ • ػೳ • ը໘ʹೖΓ͖Βͳ͍ίϯςϯ πͷεΫϩʔϧ • ίϯςϯπͷ֦େ/ॖখ • Viewͷߏ
UIScrollView ᵋ ίϯςϯπͱͳΔsubview ɹɹɹ(͜͜ͰUIImageView)
εΫϩʔϧ • Scroll͢ΔͨΊʹߦ͏ઃఆ • contentSizeϓϩύςΟΛࢦఆ • subviewʹίϯςϯπͱͳΔ ViewΛՃ ੨ɿwindowαΠζ, scrollView.bounds
ɿscrollView.contentSize ബɿsubView.bounds
ϐϯνΠϯ/ϐϯνΞτ • ϐϯνΠϯ/ϐϯνΞτ͢ΔͨΊʹߦ͏ ઃఆ • ViewControllerΛUIScrollViewDelegate ʹద߹ • viewForZoomingInScrollViewͰζʔ Ϝ͍ͨ͠viewΛฦ͢
• ζʔϜͷഒΛࢦఆ • minimumZoomScale • maximumZoomScale ੨ɿscrollView.bounds,scrollView.contentSize ബɿsubView.bounds
UIScrollViewͰϋϚͬͨͱ͜Ζ • AutoLayoutͱUIScrollViewͷҰॹʹ͏ͱ͖ • εΫϩʔϧ͠ͳ͔ͬͨΓɺίϯςϯπ͕දࣔ͞Εͳ͔ͬ ͨΓઃఆʹ͔͔࣌ؒͬͨ • ͕ղফͰ͖ͨͱ͖ʹԿ͕ͩͬͨͷ͔Α͘Θ͔ Βͳ͔ͬͨ
εΫϩʔϧྖҬͷܾΊํ ίʔυͷ߹ • scrollViewͷϓϩύςΟ ͷcontentSizeΛࢦఆ͢Δ ʢϚϧνσόΠεʹରԠ ͢Δͱ͖ࡶʣ DPOUFOU4J[F TDSPMM7JFX
"' (&" &%!" #$
εΫϩʔϧྖҬͷܾΊํ Autolayoutͷ߹ • contentSizeͷେ͖͞ Autolayout͕ࣗಈͰࢉग़ • subviewͷ෯/ߴ͞ɺ੍ Ͱܾఆ͞ΕΔ ͕͜͜ҙʂ subviewͷ෯ͱߴ͕͞શʹܾ
·ΔΑ͏ʹ੍Λࢦఆ͢Δඞཁ͋Γʂ 6*7JFX 4DSPMM7JFXͷTVCWJFX TDSPMM7JFX ϥϕϧͳͲͷ7JFX
Θ͔Γʹ͍͘ཧ༝ • AutolayoutͰ1ͭͷ viewͷҐஔɺେ͖͞Λผ ͷviewͱͷ૬ରͰܾΊΔ • ීஈ্ҐͷView()͔ Β੍ΛܾΊ͍ͯ͘Ξϓ ϩʔν͢Δ͜ͱ͕ଟ͍ʢ ͣʣ
6*7JFX ϥϕϧͳͲͷ7JFX
Θ͔Γʹ͍͘ཧ༝ • UIScrollViewΛ AutolayoutͰར༻͢Δ ߹ɺԼҐͷViewͷ੍Λ ઃఆͯ͠ɺεΫϩʔϧྖ ҬͱͳΔViewͷେ͖͞Λ ܾΊΔΞϓϩʔνͱͳΔ • ٯ͖ͷΞϓϩʔνͳͷ
ͰΘ͔Γʹ͍͘ 6*7JFX ϥϕϧͳͲͷ7JFX