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
Xamarin.iOS - AutoLayout + iOS 9
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Cyril
May 19, 2016
Programming
460
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Xamarin.iOS - AutoLayout + iOS 9
Nouveautés d'AutoLayout avec iOS 9 :
- NSLayoutAnchor
- UILayoutGuide
- UIStackView
Cyril
May 19, 2016
More Decks by Cyril
See All by Cyril
Salut .NET 5, quoi de neuf ?
cyrilcathala
0
69
Annonces de la .NET Conf 2019
cyrilcathala
0
71
Build 2018 - Xamarin
cyrilcathala
1
51
Microsoft Build 2017 Mobile Wrap-Up
cyrilcathala
0
130
Mobile Deep Linking
cyrilcathala
0
120
Programmation Réactive - Reactive Extensions
cyrilcathala
0
76
Other Decks in Programming
See All in Programming
TypeScript+Orvalで実現する型安全かつ堅牢でスケーラブルなマルチチャネル通知基盤 / TSKaigi Night talks ~after conference~
d0riven
0
300
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
410
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
3k
AIとRubyの静的型付け
ukin0k0
0
540
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
250
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.2k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
Swiftのレキシカルスコープ管理
kntkymt
0
210
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
840
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.5k
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
160
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
290
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.6k
New Earth Scene 8
popppiees
3
2.3k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
820
Into the Great Unknown - MozCon
thekraken
41
2.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
520
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
Fireside Chat
paigeccino
42
3.9k
How GitHub (no longer) Works
holman
316
150k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Transcript
AUTOLAYOUT IOS 9 Meetup Cross-Platform Native Mobile Dev Cyril CATHALA
@CyrilCathala
84% des devices sous iOS 9 (9 mai 2016) iOS
9; 84% iOS 8; 11% Earlier; 5%
iOS 9 3D Touch SFSafariViewController Spotlight Contacts APIs UIKit
nouveautés du UIKIT
NSLAYOUTANCHOR UILAYOUTGUIDE UISTACKVIEW
API de contraintes avec NSLAYOUTANCHOR
J’ADORE CONSTRUIRE MES VUES ET CONTRAINTES VIA CODE, JE FAIS
ÇA PARTOUT ! Un développeur maso
OH NON, OBLIGÉ DE GÉRER MES CONTRAINTES DANS LE CODE
… Un développeur malchanceux
C’ÉTAIT MIEUX AVANT ?
NSLAYOUTCONSTRAINT var constraint = NSLayoutConstraint.Create( button2, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, button1, NSLayoutAttribute.Trailing,
1, 15); button1 button2 15
None
VISUAL FORMAT LANGUAGE (VFL) var constraints = NSLayoutConstraint.FromVisualFormat( @”H:|-[button1(==button2)]-15-[button2]-|", NSLayoutFormatOptions.AlignAllTop,
null, views); button1 button2 15
None
Qui dit mieux ? NSLAYOUTANCHOR !
var constraint = NSLayoutConstraint.Create( button2, NSLayoutAttribute.Leading, NSLayoutRelation.Equal, button1, NSLayoutAttribute.Trailing, 1,
15); button2.LeadingAnchor.ConstraintEqualTo(button1.TrailingAnchor, 15);
DEMO TIME ! NsLayoutAnchor
meilleur agencement avec UILAYOUTGUIDE
JE VEUX CENTRER UN GROUPE DE VUES AU MILIEU DE
L’ÉCRAN ! Solution : Créer une UIView qui contient les vues, puis centrer la UIView
JE VEUX AJOUTER DES ESPACES DYNAMIQUES ENTRE MES VUES !
Solution : Créer des UIViews pour chaque espace, puis associer des contraintes
PROBLÈME : Ajout d’éléments inutiles dans la hiérarchie visuelle
UILAYOUTGUIDE N’intervient pas dans la hiérarchie visuelle ! Bémol :
pas dispo dans le designer
var guide = new UILayoutGuide(); View.AddLayoutGuide(guide); guide.LeadingAnchor .ConstraintEqualTo(View.LeadingAnchor) .Active =
true;
DEMO TIME ! UILayoutGuide
la révolution avec UISTACKVIEW
STACK VIEW Empile des vues Horizontal ou Vertical Basé sur
Auto Layout Imbricable !
ALIGNMENT SPACING DISTRIBUTION
DISTRIBUTION Fill FillEqually FillProportionnally EqualSpacing EqualCentering
ALIGNMENT Fill Center Leading Trailing Top Bottom
ALIGNMENT BASELINE FirstBaseline LastBaseline
WE FEEL THAT YOU CAN BUILD MOST OF YOUR USER
INTERFACES WITH STACK VIEWS, SO WE RECOMMEND STARTING WITH STACK VIEW AND USING CONSTRAINTS AS NEEDED. Jason Yao, Ingénieur Apple, WWDC 2015
DEMO TIME ! Stack View
APIS • AddArrangedSubview • RemoveArrangedSubview • Qui n’enlève pas de
l’arborescence visuelle ! • ArrangedSubviews • Compatible avec les animations
JE DOIS CIBLER IOS 7, JE SUIS TRISTESSE :’( Un
développeur malheureux
None
Mysteries of Auto Layout 1 & 2 https://developer.apple.com/videos/play/wwdc2015/218 Paul Hudson
sur Youtube Doc Xamarin https://developer.xamarin.com/guides/ios/platform_features/introductio n_to_ios9/uistackview
MERCI ! @CYRILCATHALA