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
Auto-Layout.pdf
Search
Shuai Liu
September 22, 2015
Technology
150
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Auto-Layout.pdf
Shuai Liu
September 22, 2015
More Decks by Shuai Liu
See All by Shuai Liu
Python-intro-2
liushuaikobe
0
97
Python-intro-1
liushuaikobe
0
95
GitRadar——毕业论文答辩
liushuaikobe
0
250
NoSQL & MongoDB
liushuaikobe
0
220
Other Decks in Technology
See All in Technology
re:Invent初参加で変わったこと、2回目にやってみたいこと(JAWS-UG彩の国埼玉 #12)
mhrtech
2
110
Kiro Crewをはじめよう
kizawa2020
1
150
自作バイナリを動かす「入口」8選
puhitaku
2
1.3k
AI × アーキテクト 第1・2章|生成AIの課題とアーキテクトの素養
daidaidai
0
120
OptunaHub: ブラックボックス最適化のためのプラットフォーム
pfn
PRO
0
110
Rust で関数型ドメインモデリング
takonda
0
100
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.5k
大型犬好きによるPugの紹介
yamanoku
1
150
Post AI時代のリファクタリング実践記 / Refactoring in the post AI era
kaminashi
1
210
WasmをRustにする
sansantech
PRO
0
230
【Data Engineering Summit2026_登壇資料】医療ビッグデータ×AIエージェントを支えるデータ基盤とハーネスエンジニアリング
jmdc_presentation
0
150
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3k
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
620
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
520
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
ラッコキーワード サービス紹介資料
rakko
1
5.3M
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Deep Space Network (abreviated)
tonyrice
0
370
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
940
Producing Creativity
orderedlist
PRO
348
41k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
470
The Pragmatic Product Professional
lauravandoore
37
7.5k
Transcript
Auto Layout
Frame + autoresizingMask Auto Layout
basis • SuperView的位置确定了,那么SubView的位置就可 以被确定 • SuperView -> SubView的{x, y, width,
height} -> SubView的位置
Cassowary You provide rules, whether through IB or through code,
and the Auto Layout system transforms those rules into view frames.
Constraint y = kx + b view1的某个属性 = k ×
view2的某个属性 + b
NSLayoutConstraint + (instancetype)constraintWithItem:(id)view1 attribute:(NSLayoutAtribute)attr1 relatedBy:(NSLayoutRelation)relation toItem:(id)view2 attribute:(NSLayoutAttribute)attr2 multiplier:(CGFloat)multipler constant:(CGFloat)c
开始Auto Layout • No frame & autoresizingMask • ⽗父View当前的⼤大⼩小是不可靠的
None
思路 • 合理的把⼦子View分组 • 确定⼤大致依赖关系 —— 要想确定A的位置,⾸首先我得知道B 的位置 & 只要B的位置定下来了,那么A的位置就可以被确定
• 找出那些只依赖⽗父View的View(⼀一定存在),先 添加他们的约束 • 根据依赖关系,⼀一级⼀一级的添加约束
None
None
None
Code
Advanced • Content Hugging & Compression Resistance • Intrinsic Content
Size • Animation