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
370
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
55
Annonces de la .NET Conf 2019
cyrilcathala
0
47
Build 2018 - Xamarin
cyrilcathala
1
34
Microsoft Build 2017 Mobile Wrap-Up
cyrilcathala
0
120
Mobile Deep Linking
cyrilcathala
0
92
Programmation Réactive - Reactive Extensions
cyrilcathala
0
69
Other Decks in Programming
See All in Programming
なぜ宣言的 UI は壊れにくいのか / Why declarative UI is less fragile
uenitty
29
13k
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
Rust.Nagoya #1
codemountains
0
170
実用的かつリーズナブルな 「Azure × Gemini × LINE」~キャラクターBot 実装ライブデモ~
tomodo_ysys
1
170
Trial
cairolibrary720
1
130
Google's Recipe for Scaling (Web) Security – LocoMocoSec 2024
lweichselbaum
0
170
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
Architectures with Lightweight Stores: New Rules and Options
manfredsteyer
PRO
0
100
12年前の『型システム入門』翻訳の思い出話
mame
11
1.2k
最近追加した型の紹介とその振り返り
aki19035vc
0
180
データカタログ運用物語 〜令和6年夏の理想と現実〜
kuro_kurorrr
0
110
CSC307 Lecture 10
javiergs
PRO
0
310
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
64
5.2k
Designing the Hi-DPI Web
ddemaree
276
34k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
662
120k
The Invisible Customer
myddelton
117
13k
Music & Morning Musume
bryan
43
5.9k
Facilitating Awesome Meetings
lara
46
5.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
17
1.5k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
360
22k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
10 Git Anti Patterns You Should be Aware of
lemiorhan
652
58k
Why Our Code Smells
bkeepers
PRO
332
56k
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