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
Transcript
14 slides
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
More Decks by Shuai Liu
See All by Shuai Liu
Python-intro-2
liushuaikobe
0
99
Python-intro-1
liushuaikobe
0
100
GitRadar——毕业论文答辩
liushuaikobe
0
270
NoSQL & MongoDB
liushuaikobe
0
230
Other Decks in Technology
See All in Technology
Intro to Kiro (One agent, every surface) | Kiro: Zero to Hero 01
inariku
PRO
2
110
「AIチャットからもできないの?」と言われたら ~業務アプリをMCP対応するときの認証・認可の勘所
oidfj
0
290
AWS基盤改善を支える 私たちの理念と行動指針
kentosuzuki
0
150
うちなーぐちが認識できるなら、秋田弁もいけるはず!? Amazon Transcribe方言チューニング検証
ryouto715
1
160
複数システムが同居した 15 年物の AWS アカウントを解体するための考古学
wa6sn
3
120
MCPでAIが自分で調べに行く
cdataj
0
150
SREのためのFinOps入門
muziyoshiz
2
1.3k
AIエージェントの監視、思考を見るか行動を見るか / Monitoring AI Agents: Thoughts or Actions
yusukeshimizu
2
180
Metadata - Section 3 : Dublin Core Standard · DC
mohab1
0
130
Frontier Teams — Amazon は AI で「開発のやり方」をどう変えたのか
kmotohas
0
130
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
5
320
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
200
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
GitHub's CSS Performance
jonrohan
1033
470k
Designing for Performance
lara
612
70k
Mind Mapping
helmedeiros
1
440
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
530
AI: The stuff that nobody shows you
jnunemaker
PRO
11
1.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
520
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
620
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300