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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
62
頻出pryコマンド
utwang
0
150
設計ポイントの 比較で知る Backbone.js
utwang
9
7.1k
Other Decks in Programming
See All in Programming
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.7k
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
1.1k
Deep dive into the select statement (GopherCon UK)
jespino
0
170
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
130
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
490
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
140
新卒PdEのリアル
ryu1013
1
480
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
520
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
590
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
3
500
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Utilizing Notion as your number one productivity tool
mfonobong
4
580
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
830
Design in an AI World
tapps
1
310
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