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
Cyril
May 19, 2016
Programming
0
430
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
56
Annonces de la .NET Conf 2019
cyrilcathala
0
53
Build 2018 - Xamarin
cyrilcathala
1
41
Microsoft Build 2017 Mobile Wrap-Up
cyrilcathala
0
120
Mobile Deep Linking
cyrilcathala
0
100
Programmation Réactive - Reactive Extensions
cyrilcathala
0
71
Other Decks in Programming
See All in Programming
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
110
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
3
300
Julia という言語について (FP in Julia « SIDE: F ») for 関数型まつり2025
antimon2
3
960
赤裸々に公開。 TSKaigiのオフシーズン
takezoux2
0
140
Java on Azure で LangGraph!
kohei3110
0
160
Spring gRPC で始める gRPC 入門 / Introduction to gRPC with Spring gRPC
mackey0225
2
520
GraphRAGの仕組みまるわかり
tosuri13
7
440
Effect の双対、Coeffect
yukikurage
5
1.4k
事業戦略を理解してソフトウェアを設計する
masuda220
PRO
22
6.2k
コード書くの好きな人向けAIコーディング活用tips #orestudy
77web
3
320
実践ArchUnit ~実例による検証パターンの紹介~
ogiwarat
2
280
Perplexity Slack Botを作ってAI活用を進めた話 / AI Engineering Summit プレイベント
n3xem
0
670
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
140
7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
The Invisible Side of Design
smashingmag
299
51k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
Git: the NoSQL Database
bkeepers
PRO
430
65k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Building Applications with DynamoDB
mza
95
6.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
790
Testing 201, or: Great Expectations
jmmastey
42
7.5k
It's Worth the Effort
3n
184
28k
Agile that works and the tools we love
rasmusluckow
329
21k
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