Thursday, January 17, 2019

iOS : Visual format language

Below are the essential syntax elements for visual layout

[button]-[textField] => Specifies standard spacing between button and textfield
[button(>=50)] => Specifies the minimum width of 50.
|-50-[purpleBox]-50-| => Specifies connection to super view, | indicates super view
V:[topField]-10-[bottomField] => Specifies vertical layout, spacing between top and bottom field being 10px.
[maroonView][blueView] => Flushing views, this means no spacing with the adjacent views. 
[button(100@20)] => This tells that the priority is 20 for the button to have width as 100
[button1(==button2)] => Equal widths for buttons button1 and button2
[flexibleButton(>=70,<=100)] => This is a multiple predicate scenario, where the width lies between 70 and 100px
|-[find]-[findNext]-[findField(>=20)]-| => This declares find and find next and find field is having standard spacing horizontally. Find and FindField is having spacing with the border of 20px. FindField is having width of at least 20px.

References:
https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/VisualFormatLanguage.html#//apple_ref/doc/uid/TP40010853-CH27-SW1

No comments:

Post a Comment