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
0
450
Xamarin.iOS - AutoLayout + iOS 9
Nouveautés d'AutoLayout avec iOS 9 :
- NSLayoutAnchor
- UILayoutGuide
- UIStackView
Cyril
May 19, 2016
Tweet
Share
More Decks by Cyril
See All by Cyril
Salut .NET 5, quoi de neuf ?
cyrilcathala
0
65
Annonces de la .NET Conf 2019
cyrilcathala
0
68
Build 2018 - Xamarin
cyrilcathala
1
46
Microsoft Build 2017 Mobile Wrap-Up
cyrilcathala
0
130
Mobile Deep Linking
cyrilcathala
0
120
Programmation Réactive - Reactive Extensions
cyrilcathala
0
73
Other Decks in Programming
See All in Programming
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
240
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
210
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
180
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1k
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
モジュラモノリスにおける境界をGoのinternalパッケージで守る
magavel
0
3.5k
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
2
320
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
150
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
450
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
170
Understanding Apache Lucene - More than just full-text search
spinscale
0
110
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.4k
[SF Ruby Conf 2025] Rails X
palkan
2
830
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
100
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Faster Mobile Websites
deanohume
310
31k
The browser strikes back
jonoalderson
0
790
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
290
A better future with KSS
kneath
240
18k
Into the Great Unknown - MozCon
thekraken
40
2.3k
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