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
140
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
96
Python-intro-1
liushuaikobe
0
90
GitRadar——毕业论文答辩
liushuaikobe
0
240
NoSQL & MongoDB
liushuaikobe
0
210
Other Decks in Technology
See All in Technology
覗いてみよう 関数型ビジュアル言語×2Dグラフィックスの世界
yohyamasaki
0
120
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
4
750
AI感のないAWS構成図をAIエージェントに描かせたい!
sagochiko
2
440
2026-09-08 そのJavaモダナイゼーション、AIに丸投げで大丈夫?IBM Bobで変わる品質と効率
yutanonaka
1
200
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
32
33k
メルカリにおけるAI時代の高速プロトタイピング基盤「Arca」
ryotarai
15
12k
HacobuにおけるFDEとは/登壇資料(戸井田 裕貴)
hacobu
PRO
1
120
C#コードの結合を可視化する Roslyn解析による設計改善と リファクタリング判断
dora56
0
830
Apache Iceberg が拓く AI 時代のオープンレイクハウス
tomtanaka
0
110
AIエージェント時代のPlatform as a Product —— テックリードがPdMとして回す発見・導入・計測 / Platform as a Product in the AI Agent Era
toshi0607
1
370
AIは推し活である。
kurazuuuuuu
2
990
Account Factory for Terraformによる 標準化されたアカウント発行の自動化
pensuke628
0
100
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
66k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
880
GraphQLとの向き合い方2022年版
quramy
50
15k
Ruling the World: When Life Gets Gamed
codingconduct
0
370
Agile that works and the tools we love
rasmusluckow
331
22k
YesSQL, Process and Tooling at Scale
rocio
174
15k
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