Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intermediate Auto Layout
Search
Peter Stuart
December 12, 2013
Technology
0
310
Intermediate Auto Layout
Talk given at CocoaHeads Boston.
Peter Stuart
December 12, 2013
Tweet
Share
Other Decks in Technology
See All in Technology
Kubernetesの「隠れメモリ消費」によるNode共倒れと、Request適正化という処方箋
g0xu
0
150
GitHub Actions侵害 — 相次ぐ事例を振り返り、次なる脅威に備える
flatt_security
8
5.8k
OPENLOGI Company Profile for engineer
hr01
1
61k
SaaSに宿る21g
kanyamaguc
2
180
RGBに陥らないために -プロダクトの価値を届けるまで-
righttouch
PRO
0
130
Why we keep our community?
kawaguti
PRO
0
330
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
220
韓非子に学ぶAI活用術
tomfook
3
1.1k
Sansanの認証基盤を支えるアーキテクチャとその振り返り
sansantech
PRO
1
110
FASTでAIエージェントを作りまくろう!
yukiogawa
4
150
FlutterでPiP再生を実装した話
s9a17
0
220
契約書からの情報抽出を行うLLMのスループットを、バッチ処理を用いて最大40%改善した話
sansantech
PRO
3
310
Featured
See All Featured
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
Product Roadmaps are Hard
iamctodd
PRO
55
12k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
280
GraphQLとの向き合い方2022年版
quramy
50
14k
The Language of Interfaces
destraynor
162
26k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Skip the Path - Find Your Career Trail
mkilby
1
90
Transcript
Intermediate Auto Layout
Layout Guides
Layout Guides id topLayoutGuide = self.topLayoutGuide; NSDictionary *views = NSDictionaryOfVariableBindings(topLayoutGuide,
someView); ... @"V:[topLayoutGuide]-[someView]" ...
Scroll Views
Scroll Views
Scroll Views [NSLayoutConstraint constraintWithItem:container attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:scrollView attribute:NSLayoutAttributeWidth multiplier:1 constant:0];
Scroll Views - (void)keyboardWillShow:(NSNotification *)notification { CGFloat offset = ...;
self.bottomConstraint.constant = offset; [UIView animate...:^{ [self.view layoutIfNeeded]; }]; }
Custom Views • Should know their intrinsic size • constraints
• intrinsicContentSize
Custom Views • Should know how to be laid out
• alignmentRectInsets
Custom Views return UIEdgeInsetsMake(25, 0, 0, 25); 1
Compression Resistance This is some pretty long text. Low High
High
Compression Resistance This is some … Low High High
Compression Resistance [view setContentCompressionResistancePriority:UILayoutPriorityDefaultLow forOrientation:UILayoutConstraintOrientationHorizontal];
Hugging Text Text Low High High Text
Hugging Text Text Low High High Text
Hugging [view setContentHuggingPriority:UILayoutPriorityDefaultLow forOrientation:UILayoutConstraintOrientationHorizontal] ;
Misc. • Align views/controls that contain text using NSLayoutAttributeBaseline, not
NSLayoutAttributeCenterY • Manage constraints with views, not view controllers • Avoid using explicit sizes